Browse Source

qtnfmac: check that MAC exists in regulatory notifier

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>
Igor Mitsyanko 7 years ago
parent
commit
4fd045cdb2
1 changed files with 3 additions and 0 deletions
  1. 3 0
      drivers/net/wireless/quantenna/qtnfmac/cfg80211.c

+ 3 - 0
drivers/net/wireless/quantenna/qtnfmac/cfg80211.c

@@ -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) {