From: Igor Mitsyanko Date: Tue, 19 Dec 2017 11:28:47 +0000 (+0300) Subject: qtnfmac: check that MAC exists in regulatory notifier X-Git-Tag: for-linus-20180210~31^2~158^2~16 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=4fd045cdb2396bfe315dbffd97157da711c7fa7f;p=linux-block.git 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 Signed-off-by: Kalle Valo --- diff --git a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c index 6711e7fb6926..63d274c3f2f7 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c +++ b/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) {