mwifiex: fix NULL pointer dereference error
authorWei-Ning Huang <wnhuang@chromium.org>
Wed, 30 Mar 2016 10:14:55 +0000 (18:14 +0800)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 7 Apr 2016 16:40:29 +0000 (19:40 +0300)
In mwifiex_enable_hs, we need to check if
priv->wdev.wiphy->wowlan_config is NULL before accessing its member.
This sometimes cause kernel panic when suspend/resume.

Signed-off-by: Wei-Ning Huang <wnhuang@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/marvell/mwifiex/sta_ioctl.c

index d5c56eb9e985f3be8d8270b5b2b9fbd6f57e6b1a..d8de432d46a204abafd0709844ebd6180a359916 100644 (file)
@@ -509,7 +509,8 @@ int mwifiex_enable_hs(struct mwifiex_adapter *adapter)
 
        if (priv && priv->sched_scanning) {
 #ifdef CONFIG_PM
-               if (!priv->wdev.wiphy->wowlan_config->nd_config) {
+               if (priv->wdev.wiphy->wowlan_config &&
+                   !priv->wdev.wiphy->wowlan_config->nd_config) {
 #endif
                        mwifiex_dbg(adapter, CMD, "aborting bgscan!\n");
                        mwifiex_stop_bg_scan(priv);