mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 22:40:54 -04:00
qcacmn: Unmap ce nbufs before free
freeing mapped memory may lead to resource leaks. Change-Id: I75664b1a987c1339aa173672c9af670f8b3ffeb8 CRs-Fixed: 2020793
This commit is contained in:
parent
b01db18853
commit
1c72830f3b
1 changed files with 11 additions and 3 deletions
|
|
@ -1233,8 +1233,11 @@ void ce_t2h_msg_ce_cleanup(struct CE_handle *ce_hdl)
|
|||
* covered that case. This is not in performance path,
|
||||
* so OK to do this.
|
||||
*/
|
||||
if (nbuf)
|
||||
if (nbuf) {
|
||||
qdf_nbuf_unmap_single(ce_state->scn->qdf_dev, nbuf,
|
||||
QDF_DMA_FROM_DEVICE);
|
||||
qdf_nbuf_free(nbuf);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1519,9 +1522,13 @@ hif_pci_ce_send_done(struct CE_handle *copyeng, void *ce_context,
|
|||
* when last fragment is complteted.
|
||||
*/
|
||||
if (transfer_context != CE_SENDLIST_ITEM_CTXT) {
|
||||
if (scn->target_status == TARGET_STATUS_RESET)
|
||||
if (scn->target_status == TARGET_STATUS_RESET) {
|
||||
|
||||
qdf_nbuf_unmap_single(scn->qdf_dev,
|
||||
transfer_context,
|
||||
QDF_DMA_TO_DEVICE);
|
||||
qdf_nbuf_free(transfer_context);
|
||||
else
|
||||
} else
|
||||
msg_callbacks->txCompletionHandler(
|
||||
msg_callbacks->Context,
|
||||
transfer_context, transfer_id,
|
||||
|
|
@ -1561,6 +1568,7 @@ static inline void hif_ce_do_recv(struct hif_msg_callbacks *msg_callbacks,
|
|||
} else {
|
||||
HIF_ERROR("%s: Invalid Rx msg buf:%p nbytes:%d",
|
||||
__func__, netbuf, nbytes);
|
||||
|
||||
qdf_nbuf_free(netbuf);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue