summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbhinav Kumar <abhikuma@codeaurora.org>2017-12-19 15:11:54 +0530
committersnandini <snandini@codeaurora.org>2017-12-22 00:44:40 -0800
commitd17a621afa905d2ff58fdcc8858cf21ca18cf994 (patch)
treea9ff30714150cb1206a54f8d275b89df87a362c1
parent05ea85c9ac0c19951168775b11c5e8ae8793a881 (diff)
qcacld-3.0: Fix mem leak in hdd_wlan_start_modules
In function hdd_wlan_start_modules, when hdd_configure_cds return error, driver does not free memory buffers, pmac->oui_info that holds all the action ouis info in sme_alloc_action_oui_info, action_oui in sme_alloc_action_oui, sme_ext in sme_set_action_oui_ext and hdd_ctx->target_hw_name in hdd_update_hw_sw_info, which are allocated when the driver is in the open state Fix is to free the memory for hdd_ctx->target_hw_name buffer and set to NULL, and call sme_destroy_config API in hdd_wlan_start_modules to free memory buffer of oui info, action oui, and action oui extn. Change-Id: Ib8bee8d4df51404e848cfd4da628ebf3f7ff718d CRs-Fixed: 2159490
-rw-r--r--core/hdd/src/wlan_hdd_main.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c
index 7b2f4681a34f..9b01e36f7884 100644
--- a/core/hdd/src/wlan_hdd_main.c
+++ b/core/hdd/src/wlan_hdd_main.c
@@ -2205,6 +2205,7 @@ int hdd_wlan_start_modules(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter,
return 0;
post_disable:
+ sme_destroy_config(hdd_ctx->hHal);
cds_post_disable();
close:
@@ -2225,7 +2226,10 @@ power_down:
release_lock:
hdd_ctx->start_modules_in_progress = false;
mutex_unlock(&hdd_ctx->iface_change_lock);
-
+ if (hdd_ctx->target_hw_name) {
+ qdf_mem_free(hdd_ctx->target_hw_name);
+ hdd_ctx->target_hw_name = NULL;
+ }
/* many adapter resources are not freed by design in SSR case */
if (!reinit)
hdd_check_for_leaks();