qtnfmac: check that MAC exists in regulatory notifier
authorIgor Mitsyanko <igor.mitsyanko.os@quantenna.com>
Tue, 19 Dec 2017 11:28:47 +0000 (14:28 +0300)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 9 Jan 2018 12:11:17 +0000 (14:11 +0200)
It is possible that regulatory notifier is called before MAC data
was allocated. We need to verify that MAC data exists before trying
to send a regulatory change event.

Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/quantenna/qtnfmac/cfg80211.c

index 6711e7f..63d274c 100644 (file)
@@ -802,6 +802,9 @@ static void qtnf_cfg80211_reg_notifier(struct wiphy *wiphy_in,
                        continue;
 
                mac = bus->mac[mac_idx];
+               if (!mac)
+                       continue;
+
                wiphy = priv_to_wiphy(mac);
 
                for (band = 0; band < NUM_NL80211_BANDS; ++band) {