diff options
| author | Poddar, Siddarth <siddpodd@codeaurora.org> | 2016-09-29 18:58:45 +0530 |
|---|---|---|
| committer | qcabuildsw <qcabuildsw@localhost> | 2016-10-03 17:33:01 -0700 |
| commit | 1ab0a3db60f0bb8e6c35b2a5e317f9e2d2d06476 (patch) | |
| tree | db488be71eda7773bbe37581ad75f435578ac7ba | |
| parent | fa2b2d18b014955b9a72fbe672fc7a5ccd5d3ca6 (diff) | |
qcacld-3.0: Fix memory leak when SSR is triggered
qcacld-2.0 to qcacld-3.0 propagation.
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/cds/inc/cds_api.h | 7 | ||||
| -rw-r--r-- | core/cds/src/cds_api.c | 16 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_power.c | 3 |
3 files changed, 26 insertions, 0 deletions
diff --git a/core/cds/inc/cds_api.h b/core/cds/inc/cds_api.h index 5f5487711488..140a453a11af 100644 --- a/core/cds/inc/cds_api.h +++ b/core/cds/inc/cds_api.h @@ -206,6 +206,13 @@ QDF_STATUS cds_enable(v_CONTEXT_t cds_context); QDF_STATUS cds_disable(v_CONTEXT_t cds_context); +/** + * cds_flush_cache_rx_queue() - flush cache rx queue frame + * + * Return: None + */ +void cds_flush_cache_rx_queue(void); + QDF_STATUS cds_close(v_CONTEXT_t cds_context); QDF_STATUS cds_shutdown(v_CONTEXT_t cds_context); diff --git a/core/cds/src/cds_api.c b/core/cds/src/cds_api.c index a493dc34c55f..bcc146f1e1d4 100644 --- a/core/cds/src/cds_api.c +++ b/core/cds/src/cds_api.c @@ -817,6 +817,22 @@ QDF_STATUS cds_close(v_CONTEXT_t cds_context) return QDF_STATUS_SUCCESS; } +void cds_flush_cache_rx_queue(void) +{ + uint8_t sta_id; + struct ol_txrx_peer_t *peer; + struct ol_txrx_pdev_t *pdev = cds_get_context(QDF_MODULE_ID_TXRX); + + for (sta_id = 0; sta_id < WLAN_MAX_STA_COUNT; sta_id++) { + peer = ol_txrx_peer_find_by_local_id(pdev, sta_id); + if (!peer) + continue; + ol_txrx_flush_rx_frames(peer, 1); + } + return; +} + + /** * cds_get_context() - get context data area * diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c index a93ef0422b49..809c4924bc3b 100644 --- a/core/hdd/src/wlan_hdd_power.c +++ b/core/hdd/src/wlan_hdd_power.c @@ -1448,6 +1448,9 @@ QDF_STATUS hdd_wlan_shutdown(void) hdd_cleanup_scan_queue(pHddCtx); hdd_reset_all_adapters(pHddCtx); + /* Flush cached rx frame queue */ + cds_flush_cache_rx_queue(); + /* De-register the HDD callbacks */ hdd_deregister_cb(pHddCtx); hdd_ipa_uc_ssr_deinit(); |
