diff --git a/core/cds/src/cds_api.c b/core/cds/src/cds_api.c index 4d0fae02ee92..39561b396cd4 100644 --- a/core/cds/src/cds_api.c +++ b/core/cds/src/cds_api.c @@ -1122,6 +1122,11 @@ QDF_STATUS cds_close(struct wlan_objmgr_psoc *psoc) { QDF_STATUS qdf_status; + qdf_status = cds_sched_close(); + QDF_ASSERT(QDF_IS_STATUS_SUCCESS(qdf_status)); + if (QDF_IS_STATUS_ERROR(qdf_status)) + cds_err("Failed to close CDS Scheduler"); + dispatcher_psoc_close(psoc); qdf_status = wma_wmi_work_close(); diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index c9ca46843058..9466dec8bdc0 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -9781,16 +9781,6 @@ int hdd_wlan_stop_modules(struct hdd_context *hdd_ctx, bool ftm_mode) QDF_ASSERT(0); } - /* - * Close the scheduler before calling cds_close to make sure - * no thread is scheduled after the each module close is - * is called i.e after all the data structures are freed. - */ - qdf_status = cds_sched_close(); - QDF_ASSERT(QDF_IS_STATUS_SUCCESS(qdf_status)); - if (QDF_IS_STATUS_ERROR(qdf_status)) - hdd_alert("Failed to close CDS Scheduler"); - qdf_status = cds_close(hdd_ctx->hdd_psoc); if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { hdd_warn("Failed to stop CDS: %d", qdf_status);