Ver código fonte

qcacld-3.0: Move cds_config cleanup into start modules

In the event of an error during cds_open, the cds config is not released
until very late in error handing process. Instead, release the cds
config immediately after an error occurs in cds_open.

Change-Id: I5fdf446c3cad82cbe3cbdec40f1dce4b46a0c3fb
CRs-Fixed: 2124189
Dustin Brown 7 anos atrás
pai
commit
28b1789ad0
1 arquivos alterados com 6 adições e 5 exclusões
  1. 6 5
      core/hdd/src/wlan_hdd_main.c

+ 6 - 5
core/hdd/src/wlan_hdd_main.c

@@ -2370,10 +2370,10 @@ int hdd_wlan_start_modules(struct hdd_context *hdd_ctx,
 		hdd_update_cds_ac_specs_params(hdd_ctx);
 
 		status = cds_open(hdd_ctx->hdd_psoc);
-		if (!QDF_IS_STATUS_SUCCESS(status)) {
+		if (QDF_IS_STATUS_ERROR(status)) {
 			hdd_err("Failed to Open CDS: %d", status);
-			ret = (status == QDF_STATUS_E_NOMEM) ? -ENOMEM : -EINVAL;
-			goto cds_free;
+			ret = qdf_status_to_os_return(status);
+			goto deinit_config;
 		}
 
 		/* initalize components configurations  after psoc open */
@@ -2468,6 +2468,9 @@ close:
 	hdd_ctx->driver_status = DRIVER_MODULES_CLOSED;
 	cds_close(hdd_ctx->hdd_psoc);
 
+deinit_config:
+	cds_deinit_ini_config();
+
 cds_free:
 	ol_cds_free();
 
@@ -9950,8 +9953,6 @@ err_hdd_free_psoc:
 	hdd_request_manager_deinit();
 	hdd_exit_netlink_services(hdd_ctx);
 
-	cds_deinit_ini_config();
-
 	hdd_objmgr_release_and_destroy_psoc(hdd_ctx);
 
 err_hdd_free_context: