diff options
| author | DARAM SUDHA <dsudha@qti.qualcomm.com> | 2014-09-19 16:13:14 +0530 |
|---|---|---|
| committer | AnjaneeDevi Kapparapu <c_akappa@qti.qualcomm.com> | 2014-09-24 20:22:16 +0530 |
| commit | 0b3c2bf6d754910707205e62647d7548dee6be4a (patch) | |
| tree | 7082b2704d51b15b330499cf13d2c5ea545b134c | |
| parent | afb5576b28ddba616d74bc99c34a232badd8779f (diff) | |
calling vos_mem_init before adf_ctx_allocation
vos_mem_init is called before adf_ctx_allocation in
hdd_wlan_startup. This would capture adf_allocation
entry in vosMemList.
Change-Id: Ifa4cc35ec2f2cd2458fb140f7a10db2ec203b058
CRs-FIXED: 726275
| -rwxr-xr-x | CORE/HDD/src/wlan_hdd_main.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c index 5ecd1fe48733..7ad0766285b5 100755 --- a/CORE/HDD/src/wlan_hdd_main.c +++ b/CORE/HDD/src/wlan_hdd_main.c @@ -11549,27 +11549,12 @@ int hdd_wlan_startup(struct device *dev, v_VOID_t *hif_sc) mutex_init(&pHddCtx->tdls_lock); #endif - /* Initialize the adf_ctx handle */ - adf_ctx = vos_mem_malloc(sizeof(*adf_ctx)); - - if (!adf_ctx) { - hddLog(VOS_TRACE_LEVEL_FATAL,"%s: Failed to allocate adf_ctx", __func__); - goto err_free_hdd_context; - } - vos_mem_zero(adf_ctx, sizeof(*adf_ctx)); - hif_init_adf_ctx(adf_ctx, hif_sc); - ((VosContextType*)pVosContext)->pHIFContext = hif_sc; - - /* store target type and target version info in hdd ctx */ - pHddCtx->target_type = ((struct ol_softc *)hif_sc)->target_type; - ((VosContextType*)(pVosContext))->adf_ctx = adf_ctx; - // Load all config first as TL config is needed during vos_open pHddCtx->cfg_ini = (hdd_config_t*) kmalloc(sizeof(hdd_config_t), GFP_KERNEL); if(pHddCtx->cfg_ini == NULL) { hddLog(VOS_TRACE_LEVEL_FATAL,"%s: Failed kmalloc hdd_config_t",__func__); - goto err_free_adf_context; + goto err_free_hdd_context; } vos_mem_zero(pHddCtx->cfg_ini, sizeof( hdd_config_t )); @@ -11591,6 +11576,21 @@ int hdd_wlan_startup(struct device *dev, v_VOID_t *hif_sc) __func__, pHddCtx->cfg_ini->IsMemoryDebugSupportEnabled); #endif + /* Initialize the adf_ctx handle */ + adf_ctx = vos_mem_malloc(sizeof(*adf_ctx)); + + if (!adf_ctx) { + hddLog(VOS_TRACE_LEVEL_FATAL,"%s: Failed to allocate adf_ctx", __func__); + goto err_config; + } + vos_mem_zero(adf_ctx, sizeof(*adf_ctx)); + hif_init_adf_ctx(adf_ctx, hif_sc); + ((VosContextType*)pVosContext)->pHIFContext = hif_sc; + + /* store target type and target version info in hdd ctx */ + pHddCtx->target_type = ((struct ol_softc *)hif_sc)->target_type; + ((VosContextType*)(pVosContext))->adf_ctx = adf_ctx; + pHddCtx->current_intf_count=0; pHddCtx->max_intf_count = CSR_ROAM_SESSION_MAX; @@ -11638,7 +11638,7 @@ int hdd_wlan_startup(struct device *dev, v_VOID_t *hif_sc) { hddLog(VOS_TRACE_LEVEL_FATAL, "%s: wlan_hdd_cfg80211_init return failure", __func__); - goto err_config; + goto err_free_adf_context; } } @@ -12366,14 +12366,14 @@ err_free_ftm_open: #endif } +err_free_adf_context: + hif_deinit_adf_ctx(hif_sc); + vos_mem_free(adf_ctx); + err_config: kfree(pHddCtx->cfg_ini); pHddCtx->cfg_ini= NULL; -err_free_adf_context: - vos_mem_free(adf_ctx); - hif_deinit_adf_ctx(hif_sc); - err_free_hdd_context: /* wiphy_free() will free the HDD context so remove global reference */ if (pVosContext) |
