From cda57668d78ad3f58e9eb59b6bca8fa1061c31c4 Mon Sep 17 00:00:00 2001 From: Ashish Kumar Dhanotiya Date: Mon, 14 Aug 2017 14:45:25 +0530 Subject: [PATCH] qcacld-3.0: Fix crash during con_mod_handler During con_mod_handler, cleanup of adapter is being done first and then wlan modules are getting closed. Because of which NAPI poll is still posting frames to a device/adapter which has been freed as part of mode change handler, leading to a crash. To address this issue first stop all wlan modules and then cleanup the adapter. Change-Id: I2fade59d1e4a27620cecadb91f69866e79c85612 CRs-Fixed: 2092132 --- core/hdd/src/wlan_hdd_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index ca9f4723b5..e2b844a6af 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -11251,15 +11251,15 @@ static int __con_mode_handler(const char *kmessage, struct kernel_param *kp, goto reset_flags; } - /* 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(con_mode); /* Register for new con_mode & then kick_start modules again */