summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNaveen Rawat <naveenrawat@codeaurora.org>2017-01-27 16:17:21 -0800
committerqcabuildsw <qcabuildsw@localhost>2017-01-30 12:42:02 -0800
commit81b2c0945b317cf5ed95f1fddb496f192c13b65e (patch)
tree6a7c7bf20939330b27e379a2da72a40474700c25
parent7b2a81ba86ee73cc0cfc483b6b2a1875c361de01 (diff)
qcacld-3.0: Fix memory leak in wmi stats req without rsp
While sending WMI_REQUEST_STATS_CMDID, wma stores the request in a allocated buffer, which is freed once firmware response is received. However in case of driver unload, before we receive firmware event, the buffer will not be freed and that will be leaked. Fix the memory leak by checking for these buffers at time of wma_wmi_service_close. Change-Id: Ie8fd5faec22ceaba415a26becf98030bc7cc13ce Crs-Fixed: 1116622
-rw-r--r--core/wma/src/wma_main.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c
index 2ed4eaf331af..2b16119eac4f 100644
--- a/core/wma/src/wma_main.c
+++ b/core/wma/src/wma_main.c
@@ -3383,6 +3383,11 @@ QDF_STATUS wma_wmi_service_close(void *cds_ctx)
qdf_mem_free(wma_handle->interfaces[i].del_staself_req);
wma_handle->interfaces[i].del_staself_req = NULL;
}
+
+ if (wma_handle->interfaces[i].stats_rsp) {
+ qdf_mem_free(wma_handle->interfaces[i].stats_rsp);
+ wma_handle->interfaces[i].stats_rsp = NULL;
+ }
}
qdf_mem_free(wma_handle->interfaces);