diff --git a/core/cds/src/cds_api.c b/core/cds/src/cds_api.c index 0248d3097230..49282e464e9a 100644 --- a/core/cds/src/cds_api.c +++ b/core/cds/src/cds_api.c @@ -1916,14 +1916,6 @@ static void cds_trigger_recovery_handler(const char *func, const uint32_t line) cds_force_assert_target(qdf); cds_set_assert_target_in_progress(false); - /* - * if *wlan* recovery is disabled, once all the required registers are - * read via the platform driver check and crash the system. - */ - if (qdf->bus_type == QDF_BUS_TYPE_PCI && !ssr_ini_enabled) - QDF_DEBUG_PANIC("WLAN recovery is not enabled (via %s:%d)", - func, line); - status = qdf_runtime_pm_allow_suspend(&rtl); if (QDF_IS_STATUS_ERROR(status)) cds_err("Failed to release runtime pm lock"); diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c index 31cefedba3b0..377b5ba8d1b2 100644 --- a/core/hdd/src/wlan_hdd_power.c +++ b/core/hdd/src/wlan_hdd_power.c @@ -1309,6 +1309,8 @@ QDF_STATUS hdd_wlan_shutdown(void) struct hdd_context *hdd_ctx; struct hdd_adapter *adapter; void *soc = cds_get_context(QDF_MODULE_ID_SOC); + qdf_device_t qdf = cds_get_context(QDF_MODULE_ID_QDF_DEVICE); + bool ssr_ini_enabled = cds_is_self_recovery_enabled(); hdd_info("WLAN driver shutting down!"); @@ -1319,6 +1321,18 @@ QDF_STATUS hdd_wlan_shutdown(void) return QDF_STATUS_E_FAILURE; } + if (!qdf) { + hdd_err("Qdf context is null"); + return QDF_STATUS_E_INVAL; + } + + /* + * if *wlan* recovery is disabled, once all the required registers are + * read via the platform driver check and crash the system. + */ + if (qdf->bus_type == QDF_BUS_TYPE_PCI && !ssr_ini_enabled) + QDF_DEBUG_PANIC("WLAN recovery is not enabled"); + hdd_set_connection_in_progress(false); policy_mgr_clear_concurrent_session_count(hdd_ctx->psoc);