diff --git a/core/cds/src/cds_api.c b/core/cds/src/cds_api.c index 0f721f246f65..0c9487534179 100644 --- a/core/cds/src/cds_api.c +++ b/core/cds/src/cds_api.c @@ -1217,10 +1217,10 @@ QDF_STATUS cds_dp_close(struct wlan_objmgr_psoc *psoc) cdp_txrx_intr_detach(gp_cds_context->dp_soc); ctx = cds_get_context(QDF_MODULE_ID_TXRX); - cds_set_context(QDF_MODULE_ID_TXRX, NULL); - pmo_ucfg_psoc_set_txrx_handle(psoc, NULL); cdp_pdev_detach(cds_get_context(QDF_MODULE_ID_SOC), (struct cdp_pdev *)ctx, 1); + cds_set_context(QDF_MODULE_ID_TXRX, NULL); + pmo_ucfg_psoc_set_txrx_handle(psoc, NULL); return QDF_STATUS_SUCCESS; } diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index e1393c648d44..53219c8b576d 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -9971,6 +9971,8 @@ int hdd_wlan_stop_modules(struct hdd_context *hdd_ctx, bool ftm_mode) QDF_ASSERT(0); } + hdd_runtime_suspend_context_deinit(hdd_ctx); + ret = hdd_objmgr_release_and_destroy_pdev(hdd_ctx); if (ret) { hdd_err("Failed to destroy pdev; errno:%d", ret); @@ -10004,8 +10006,6 @@ int hdd_wlan_stop_modules(struct hdd_context *hdd_ctx, bool ftm_mode) ret = -EINVAL; } - hdd_runtime_suspend_context_deinit(hdd_ctx); - if (hdd_ctx->target_hw_name) { qdf_mem_free(hdd_ctx->target_hw_name); hdd_ctx->target_hw_name = NULL;