diff options
| author | Poddar, Siddarth <siddpodd@qti.qualcomm.com> | 2016-08-05 20:09:43 +0530 |
|---|---|---|
| committer | Anjaneedevi Kapparapu <akappa@codeaurora.org> | 2016-08-11 17:37:23 +0530 |
| commit | 32d862c5ebb01975924289d6fc97c2fd4da86e61 (patch) | |
| tree | 251723ee30f3dc44eea506631849ac9c5489a382 | |
| parent | e33659efe3442089298fb6c3c27d0fd6f34c0c9b (diff) | |
qcacld-2.0: Fix memory leak when SSR is triggered
Packets are not freed from cache buffer and causes memory
leak in SSR case. Flush cache RX frame queue to avoid this memory leak.
Change-Id: Idd9edde6fdb3b9ff3ecbe7d8139f9a66468b70af
CRs-Fixed: 1051019
| -rw-r--r-- | CORE/CLD_TXRX/TLSHIM/tl_shim.c | 24 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_early_suspend.c | 1 | ||||
| -rw-r--r-- | CORE/TL/inc/wlan_qct_tl.h | 8 |
3 files changed, 33 insertions, 0 deletions
diff --git a/CORE/CLD_TXRX/TLSHIM/tl_shim.c b/CORE/CLD_TXRX/TLSHIM/tl_shim.c index 32125d41baf2..c35772e2c5bc 100644 --- a/CORE/CLD_TXRX/TLSHIM/tl_shim.c +++ b/CORE/CLD_TXRX/TLSHIM/tl_shim.c @@ -1805,6 +1805,30 @@ VOS_STATUS WLANTL_ClearSTAClient(void *vos_ctx, u_int8_t sta_id) return VOS_STATUS_SUCCESS; } +void tl_shim_flush_cache_rx_queue(void) +{ + void *vos_ctx = vos_get_global_context(VOS_MODULE_ID_TL, NULL); + struct txrx_tl_shim_ctx *tl_shim; + u_int8_t sta_id; + + if (!vos_ctx) { + TLSHIM_LOGE("%s, Global VOS context is Null\n", __func__); + return; + } + + tl_shim = vos_get_context(VOS_MODULE_ID_TL, vos_ctx); + if (!tl_shim) { + TLSHIM_LOGE("%s, tl_shim is NULL\n", __func__); + return; + } + + TLSHIM_LOGD("%s: called to flush cache rx queue.\n", __func__); + for (sta_id = 0; sta_id < WLAN_MAX_STA_COUNT; sta_id++) + tl_shim_flush_rx_frames(vos_ctx, tl_shim, sta_id, 1); + + return; +} + /* * Register a station for data service. This API gives flexibility * to register different callbacks for different client though it is diff --git a/CORE/HDD/src/wlan_hdd_early_suspend.c b/CORE/HDD/src/wlan_hdd_early_suspend.c index 73f5d2240199..1eda234e21a4 100644 --- a/CORE/HDD/src/wlan_hdd_early_suspend.c +++ b/CORE/HDD/src/wlan_hdd_early_suspend.c @@ -2060,6 +2060,7 @@ VOS_STATUS hdd_wlan_shutdown(void) vos_free_tlshim_pkt_freeq(vosSchedContext); #endif + tl_shim_flush_cache_rx_queue(); hddLog(VOS_TRACE_LEVEL_FATAL, "%s: Doing WDA STOP", __func__); vosStatus = WDA_stop(pVosContext, HAL_STOP_TYPE_RF_KILL); diff --git a/CORE/TL/inc/wlan_qct_tl.h b/CORE/TL/inc/wlan_qct_tl.h index 8f75d1d527b8..23e62f0d4487 100644 --- a/CORE/TL/inc/wlan_qct_tl.h +++ b/CORE/TL/inc/wlan_qct_tl.h @@ -900,6 +900,14 @@ WLANTL_ClearSTAClient ); /*=========================================================================== + * tl_shim_flush_cache_rx_queue() - flush cache rx queue frame + * + * + * Return: None + ============================================================================*/ +void tl_shim_flush_cache_rx_queue(void); + +/*=========================================================================== FUNCTION WLANTL_ChangeSTAState |
