Răsfoiți Sursa

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
nakul kachhwaha 5 ani în urmă
părinte
comite
ed09dc9304
1 a modificat fișierele cu 8 adăugiri și 2 ștergeri
  1. 8 2
      core/hdd/src/wlan_hdd_main.c

+ 8 - 2
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);