diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index af5de32a9d2d..b2975740f3b3 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -6504,8 +6504,6 @@ static void hdd_wlan_exit(struct hdd_context *hdd_ctx) hdd_enter(); - qdf_cancel_delayed_work(&hdd_ctx->iface_idle_work); - hdd_unregister_notifiers(hdd_ctx); hdd_bus_bandwidth_destroy(hdd_ctx); @@ -11901,12 +11899,20 @@ err_hdd_init: */ static void __hdd_module_exit(void) { + struct hdd_context *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); pr_info("%s: Unloading driver v%s\n", WLAN_MODULE_NAME, QWLAN_VERSIONSTR); + if (!hdd_ctx) { + hdd_err("hdd context is NULL return!!"); + return; + } + hdd_wait_for_recovery_completion(); + qdf_cancel_delayed_work(&hdd_ctx->iface_idle_work); + wlan_hdd_unregister_driver(); qdf_wake_lock_destroy(&wlan_wake_lock);