diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 287ce30275..d1f50d9b45 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -12191,17 +12191,23 @@ static int __con_mode_handler(const char *kmessage, struct kernel_param *kp, /* ensure adapters are stopped */ hdd_stop_present_mode(hdd_ctx, curr_mode); + /* Cleanup present mode before switching to new mode */ + hdd_cleanup_present_mode(hdd_ctx, curr_mode); + ret = hdd_wlan_stop_modules(hdd_ctx, true); if (ret) { hdd_err("Stop wlan modules failed"); goto reset_flags; } - /* Cleanup present mode before switching to new mode */ - hdd_cleanup_present_mode(hdd_ctx, curr_mode); hdd_set_conparam(new_con_mode); + /* + * Set ACTIVE domain before adapters created, otherwise check domain + * match will fail when cleanup adapters. + */ + hdd_debug_domain_set(QDF_DEBUG_DOMAIN_ACTIVE); /* Register for new con_mode & then kick_start modules again */ ret = hdd_register_req_mode(hdd_ctx, new_con_mode); if (ret) {