summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/broadcom
diff options
context:
space:
mode:
authorFranky Lin <frankyl@broadcom.com>2016-02-17 13:26:52 +0300
committerKalle Valo <kvalo@codeaurora.org>2016-03-07 15:14:43 +0300
commit6ea09153b6ccbee79869537ce61f5c16f736d72b (patch)
tree246d7eb42cc4e1fa50635df054b6df834ad0590d /drivers/net/wireless/broadcom
parentd536733442d14664437dc9c3ec993d97b5a4f1b1 (diff)
downloadlinux-6ea09153b6ccbee79869537ce61f5c16f736d72b.tar.xz
brcmfmac: check for wowl support before enumerating feature flag
In some cases wiphy->wowlan could be NULL if firmware doesn't have the support. Driver should check for support before walking down the feature flags. Reviewed-by: Arend Van Spriel <arend@broadcom.com> Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Reviewed-by: Hante Meuleman <meuleman@broadcom.com> Signed-off-by: Franky Lin <frankyl@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/broadcom')
-rw-r--r--drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
index 5478128af02b..d66f08fa408c 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
@@ -6594,7 +6594,8 @@ struct brcmf_cfg80211_info *brcmf_cfg80211_attach(struct brcmf_pub *drvr,
if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_SCAN_RANDOM_MAC)) {
wiphy->features |= NL80211_FEATURE_SCHED_SCAN_RANDOM_MAC_ADDR;
#ifdef CONFIG_PM
- if (wiphy->wowlan->flags & WIPHY_WOWLAN_NET_DETECT)
+ if (wiphy->wowlan &&
+ wiphy->wowlan->flags & WIPHY_WOWLAN_NET_DETECT)
wiphy->features |= NL80211_FEATURE_ND_RANDOM_MAC_ADDR;
#endif
}