From ed09dc9304fe436e111bf371400a28467fe6886b Mon Sep 17 00:00:00 2001 From: nakul kachhwaha Date: Tue, 21 May 2019 14:20:06 +0530 Subject: [PATCH] qcacld-3.0: Handle error returned by cfg_parse Host driver should exit if it fails to initialize __cfg_global_store to avoid assertion hit. Change-Id: I404e5da69cd2c4cf06d55a1d7a96d0aee1e5e4a4 CRs-Fixed: 2454969 --- core/hdd/src/wlan_hdd_main.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 76ec1eecf4e3..250a1a79ea7b 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -9644,14 +9644,17 @@ struct hdd_context *hdd_context_create(struct device *dev) } status = cfg_parse(WLAN_INI_FILE); - if (QDF_IS_STATUS_ERROR(status)) + if (QDF_IS_STATUS_ERROR(status)) { hdd_err("Failed to parse cfg %s; status:%d\n", WLAN_INI_FILE, status); + ret = qdf_status_to_os_return(status); + goto err_free_config; + } ret = hdd_objmgr_create_and_store_psoc(hdd_ctx, DEFAULT_PSOC_ID); if (ret) { QDF_DEBUG_PANIC("Psoc creation fails!"); - goto err_free_config; + goto err_release_store; } hdd_cfg_params_init(hdd_ctx); @@ -9706,6 +9709,9 @@ err_deinit_hdd_context: err_hdd_objmgr_destroy: hdd_objmgr_release_and_destroy_psoc(hdd_ctx); +err_release_store: + cfg_release(); + err_free_config: qdf_mem_free(hdd_ctx->config);