qcacld-3.0: Ignore uninitialized driver mode change

The driver mode can be dynamically controlled via the module parameter
"con_mode," which triggers the callback con_mode_handler(). However, if
the wlan module is loaded with a non-default con_mode, this callback
handler is invoked before module init (e.g. 'insmod wlan.ko
con_mode=5'). If con_mode_handler is invoked before module init, simply
return success, as no processing is needed.

Change-Id: Iaa426188d13507cc6c7f09a03effd881854bbf3d
CRs-Fixed: 2349370
This commit is contained in:
Dustin Brown 2018-11-13 10:57:45 -08:00 • committed by nshrivas
commit 13fa987a29

View file

@ -13440,6 +13440,14 @@ static int con_mode_handler(const char *kmessage, const struct kernel_param *kp)
hdd_enter();
/* This handler will be invoked before module init when the wlan driver
* is loaded using 'insmod wlan.ko con_mode=5' for example. Return
* success in this case, as module init will bring up the correct
* con_mode when it runs.
*/
if (hdd_driver->state == driver_state_uninit)
return 0;
status = dsc_driver_trans_start_wait(hdd_driver->dsc_driver,
"mode change");
if (QDF_IS_STATUS_ERROR(status)) {