From 33faae85d7e91cf6b6a44a71cd7fc6d2cf08b5ca Mon Sep 17 00:00:00 2001 From: "Poddar, Siddarth" Date: Tue, 18 Apr 2017 14:05:09 +0530 Subject: [PATCH] qcacld-3.0: Fix memory leak in htt_tx_ipa_uc_attach TX BUF POOL vaddr storage alloc is not freed in htt_tx_ipa_uc_attach when paddr storage allocation fails. Fix is to free memory in failure case. CRs-Fixed: 2034943 Change-Id: Ifb26dfdcff19b3ab66f11a89b9c185777eeec535 --- core/dp/htt/htt_tx.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/dp/htt/htt_tx.c b/core/dp/htt/htt_tx.c index 4bca4ebb03e7..2068fc66adac 100644 --- a/core/dp/htt/htt_tx.c +++ b/core/dp/htt/htt_tx.c @@ -1315,7 +1315,7 @@ int htt_tx_ipa_uc_attach(struct htt_pdev_t *pdev, if (!pdev->ipa_uc_tx_rsc.paddr_strg) { qdf_print("%s: TX BUF POOL paddr storage alloc fail", __func__); return_code = -ENOBUFS; - goto free_tx_comp_base; + goto free_tx_buf_pool_vaddr_strg; } pdev->ipa_uc_tx_rsc.alloc_tx_buf_cnt = htt_tx_ipa_uc_wdi_tx_buf_alloc( @@ -1324,6 +1324,8 @@ int htt_tx_ipa_uc_attach(struct htt_pdev_t *pdev, return 0; +free_tx_buf_pool_vaddr_strg: + qdf_mem_free(pdev->ipa_uc_tx_rsc.tx_buf_pool_vaddr_strg); free_tx_comp_base: qdf_mem_free_consistent(pdev->osdev, pdev->osdev->dev, tx_comp_ring_size,