From 28b1789ad0c466117d41dd1135a68455f259e72f Mon Sep 17 00:00:00 2001 From: Dustin Brown Date: Tue, 10 Oct 2017 13:29:38 -0700 Subject: [PATCH] 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 --- core/hdd/src/wlan_hdd_main.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 597235f3fb13..40cbc5ea0771 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/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: