diff options
| author | Orhan K Akyildiz <oka@qca.qualcomm.com> | 2014-11-10 17:07:25 -0800 |
|---|---|---|
| committer | AnjaneeDevi Kapparapu <c_akappa@qti.qualcomm.com> | 2014-11-11 18:37:54 +0530 |
| commit | 2b65d15785e0d2aac2aebefbdb593a5f23075a3f (patch) | |
| tree | e720aca616dc8bc75e860e417bd051bd8dca28ca | |
| parent | 069428a5b559e87009a65941479641993d664390 (diff) | |
qcacld: Fix memory leak in htt_rx.c::htt_rx_deinit()
Fixes two memory leaks:
1) A success path memory leak which happens every time wlan driver is
unloaded. This is because htt_rx_hash_deinit function used to miss
deallocation of [htt_]pdev->hash_table.
2) In function htt_rx_hash_deinit(), there is also a memory leak in
failure path. It happens if the hash_table allocation is successful,
but allocation of one of the subsequent hash bucket entries fails.
In this case, previously allocated hash-bucket entries are deallocated
properly, but the hash_table was not de-allocated, causing the leak.
CRs-Fixed: 753700
Change-Id: I4cd7ec0e671fca2e360eacd8fa0b4445c9bd8806
| -rw-r--r-- | CORE/CLD_TXRX/HTT/htt_rx.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/CORE/CLD_TXRX/HTT/htt_rx.c b/CORE/CLD_TXRX/HTT/htt_rx.c index 4443d8321693..77a70faf893f 100644 --- a/CORE/CLD_TXRX/HTT/htt_rx.c +++ b/CORE/CLD_TXRX/HTT/htt_rx.c @@ -2331,6 +2331,8 @@ htt_rx_hash_init(struct htt_pdev_t *pdev) i--; adf_os_mem_free(pdev->rx_ring.hash_table[i].entries); } + adf_os_mem_free(pdev->rx_ring.hash_table); + pdev->rx_ring.hash_table = NULL; return 1; } @@ -2379,6 +2381,10 @@ htt_rx_hash_deinit(struct htt_pdev_t *pdev) adf_os_mem_free(pdev->rx_ring.hash_table[i].entries); } + if (NULL != pdev->rx_ring.hash_table) { + adf_os_mem_free(pdev->rx_ring.hash_table); + pdev->rx_ring.hash_table = NULL; + } } void |
