summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Hsu <ryanhsu@qca.qualcomm.com>2015-02-12 15:03:26 -0800
committerAnjaneeDevi Kapparapu <c_akappa@qti.qualcomm.com>2015-02-18 19:03:17 +0530
commitb3e0dfdaf5c3afb332a372d33fd31cb6fa09b917 (patch)
tree1fab39258670711de99c5d6e992f966df2801b08
parent2d67c739e107274296f8ead9effda67d3a93b33c (diff)
qcacld2.0: HDD: Fix for issues reported by Static Analysis
This is prima to qcacld-2.0 propagation. Free dynamically allocated memory 'pHddCtx->cfg_ini'in hdd_wlan_exit() irrespective of pAdapter value. Change-Id: I91206f92c064d045305a64f344a8bad3a3b40e52 CRs-Fixed: 795261
-rw-r--r--CORE/HDD/src/wlan_hdd_ftm.c4
-rwxr-xr-xCORE/HDD/src/wlan_hdd_main.c11
2 files changed, 7 insertions, 8 deletions
diff --git a/CORE/HDD/src/wlan_hdd_ftm.c b/CORE/HDD/src/wlan_hdd_ftm.c
index 71ab148e354f..d0762a8f93ae 100644
--- a/CORE/HDD/src/wlan_hdd_ftm.c
+++ b/CORE/HDD/src/wlan_hdd_ftm.c
@@ -841,10 +841,6 @@ int wlan_hdd_ftm_close(hdd_context_t *pHddCtx)
VOS_ASSERT( VOS_IS_STATUS_SUCCESS( vosStatus ) );
}
- //Free up dynamically allocated members inside HDD Adapter
- kfree(pHddCtx->cfg_ini);
- pHddCtx->cfg_ini= NULL;
-
#if defined(QCA_WIFI_FTM) && defined(LINUX_QCMBR)
spin_lock_bh(&qcmbr_queue_lock);
if (!list_empty(&qcmbr_queue_head)) {
diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c
index 0a0e72c397da..50f678431f86 100755
--- a/CORE/HDD/src/wlan_hdd_main.c
+++ b/CORE/HDD/src/wlan_hdd_main.c
@@ -11717,10 +11717,6 @@ void hdd_wlan_exit(hdd_context_t *pHddCtx)
#ifdef IPA_OFFLOAD
hdd_ipa_cleanup(pHddCtx);
#endif
- //Free up dynamically allocated members inside HDD Adapter
- kfree(pHddCtx->cfg_ini);
- pHddCtx->cfg_ini= NULL;
-
/* free the power on lock from platform driver */
if (free_riva_power_on_lock("wlan"))
@@ -11734,6 +11730,13 @@ void hdd_wlan_exit(hdd_context_t *pHddCtx)
hdd_list_destroy(&pHddCtx->hdd_roc_req_q);
free_hdd_ctx:
+
+ /* Free up dynamically allocated members inside HDD Adapter */
+ if (pHddCtx->cfg_ini) {
+ kfree(pHddCtx->cfg_ini);
+ pHddCtx->cfg_ini= NULL;
+ }
+
/* FTM mode, WIPHY did not registered
If un-register here, system crash will happen */
if (VOS_FTM_MODE != hdd_get_conparam())