summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarthick S <skarthic@qti.qualcomm.com>2015-02-20 14:37:49 +0530
committerAnjaneeDevi Kapparapu <c_akappa@qti.qualcomm.com>2015-02-24 16:23:40 +0530
commitcb96d1060aee25a400a80cf786f15423dbed1009 (patch)
treecd8f4acdbe19c9ad9654d90a3ab8eed7a57f8369
parentca00429ab0f2baddf6626e5c80803e1f2f7148c4 (diff)
wlan: Fix for memory leak
When WDA_TxPacket fails to send mgmt frame to txrx module, call the download completion before returning failure. So that umac can free up the frame buffer. Change-Id: I8787273f4e5424958c057c28c25ad80fa7e8a896 CRs-fixed: 788803
-rw-r--r--CORE/SERVICES/WMA/wma.c17
-rw-r--r--CORE/SERVICES/WMA/wma.h2
2 files changed, 15 insertions, 4 deletions
diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c
index 985fea0596d0..53f38e063c4e 100644
--- a/CORE/SERVICES/WMA/wma.c
+++ b/CORE/SERVICES/WMA/wma.c
@@ -26855,7 +26855,9 @@ VOS_STATUS WDA_TxPacket(void *wma_context, void *tx_frame, u_int16_t frmLen,
adf_nbuf_unmap_single(pdev->osdev, skb, ADF_OS_DMA_TO_DEVICE);
/* Call Download Cb so that umac can free the buffer */
if (tx_frm_download_comp_cb)
- tx_frm_download_comp_cb(wma_handle->mac_context, tx_frame, 1);
+ tx_frm_download_comp_cb(wma_handle->mac_context,
+ tx_frame,
+ WMA_TX_FRAME_BUFFER_FREE);
wma_handle->umac_data_ota_ack_cb = NULL;
wma_handle->last_umac_data_nbuf = NULL;
return VOS_STATUS_E_FAILURE;
@@ -26863,7 +26865,9 @@ VOS_STATUS WDA_TxPacket(void *wma_context, void *tx_frame, u_int16_t frmLen,
/* Call Download Callback if passed */
if (tx_frm_download_comp_cb)
- tx_frm_download_comp_cb(wma_handle->mac_context, tx_frame, 0);
+ tx_frm_download_comp_cb(wma_handle->mac_context,
+ tx_frame,
+ WMA_TX_FRAME_BUFFER_NO_FREE);
return VOS_STATUS_SUCCESS;
}
@@ -26953,9 +26957,13 @@ VOS_STATUS WDA_TxPacket(void *wma_context, void *tx_frame, u_int16_t frmLen,
/*
* Failed to send Tx Mgmt Frame
- * Return Failure so that umac can freeup the buf
*/
if (status) {
+ /* Call Download Cb so that umac can free the buffer */
+ if (tx_frm_download_comp_cb)
+ tx_frm_download_comp_cb(wma_handle->mac_context,
+ tx_frame,
+ WMA_TX_FRAME_BUFFER_FREE);
WMA_LOGP("%s: Failed to send Mgmt Frame", __func__);
goto error;
}
@@ -26995,7 +27003,8 @@ VOS_STATUS WDA_TxPacket(void *wma_context, void *tx_frame, u_int16_t frmLen,
* callback once the frame is successfully
* given to txrx module
*/
- tx_frm_download_comp_cb(wma_handle->mac_context, tx_frame, 0);
+ tx_frm_download_comp_cb(wma_handle->mac_context, tx_frame,
+ WMA_TX_FRAME_BUFFER_NO_FREE);
}
return VOS_STATUS_SUCCESS;
diff --git a/CORE/SERVICES/WMA/wma.h b/CORE/SERVICES/WMA/wma.h
index 0d5ac43c302c..74b0c025c259 100644
--- a/CORE/SERVICES/WMA/wma.h
+++ b/CORE/SERVICES/WMA/wma.h
@@ -1141,6 +1141,8 @@ u_int16_t get_regdmn_5g(u_int32_t reg_dmn);
* TODO: Need to Revist the Timing
*/
#define WMA_TX_FRAME_COMPLETE_TIMEOUT 1000
+#define WMA_TX_FRAME_BUFFER_NO_FREE 0
+#define WMA_TX_FRAME_BUFFER_FREE 1
struct wma_tx_ack_work_ctx {
tp_wma_handle wma_handle;