344-0003-brcmfmac-check-for-wowl-support-before-enumerating-f.patch 1.2 KB

1234567891011121314151617181920212223242526272829
  1. From: Franky Lin <frankyl@broadcom.com>
  2. Date: Wed, 17 Feb 2016 11:26:52 +0100
  3. Subject: [PATCH] brcmfmac: check for wowl support before enumerating feature
  4. flag
  5. In some cases wiphy->wowlan could be NULL if firmware doesn't have the
  6. support. Driver should check for support before walking down the feature
  7. flags.
  8. Reviewed-by: Arend Van Spriel <arend@broadcom.com>
  9. Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
  10. Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
  11. Signed-off-by: Franky Lin <frankyl@broadcom.com>
  12. Signed-off-by: Arend van Spriel <arend@broadcom.com>
  13. Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
  14. ---
  15. --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
  16. +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
  17. @@ -6594,7 +6594,8 @@ struct brcmf_cfg80211_info *brcmf_cfg802
  18. if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_SCAN_RANDOM_MAC)) {
  19. wiphy->features |= NL80211_FEATURE_SCHED_SCAN_RANDOM_MAC_ADDR;
  20. #ifdef CONFIG_PM
  21. - if (wiphy->wowlan->flags & WIPHY_WOWLAN_NET_DETECT)
  22. + if (wiphy->wowlan &&
  23. + wiphy->wowlan->flags & WIPHY_WOWLAN_NET_DETECT)
  24. wiphy->features |= NL80211_FEATURE_ND_RANDOM_MAC_ADDR;
  25. #endif
  26. }