Message ID | iwlwifi.20210409123755.381cfb3f1dc1.I6b7f5790fa0958ed8049cf02ac2a535c61e9bc96@changeid |
---|---|
State | New |
Headers | show |
Series | cfg80211/mac80211 patches from our internal tree 2021-04-09 | expand |
diff --git a/net/mac80211/main.c b/net/mac80211/main.c index f27aed37ed2b..ba624cb250b3 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c @@ -1137,8 +1137,11 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) if (local->hw.wiphy->max_scan_ie_len) local->hw.wiphy->max_scan_ie_len -= local->scan_ies_len; - WARN_ON(!ieee80211_cs_list_valid(local->hw.cipher_schemes, - local->hw.n_cipher_schemes)); + if (WARN_ON(!ieee80211_cs_list_valid(local->hw.cipher_schemes, + local->hw.n_cipher_schemes))) { + result = -EINVAL; + goto fail_workqueue; + } result = ieee80211_init_cipher_suites(local); if (result < 0)