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
This commit is contained in:
Ashish Kumar Dhanotiya 2017-08-14 14:45:25 +05:30 • committed by snandini
commit cda57668d7

View file

@ -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 */