aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/wireless/reg.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 8d176a8010ba..df0ced9405d3 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -1344,13 +1344,22 @@ void wiphy_apply_custom_regulatory(struct wiphy *wiphy,
1344 const struct ieee80211_regdomain *regd) 1344 const struct ieee80211_regdomain *regd)
1345{ 1345{
1346 enum ieee80211_band band; 1346 enum ieee80211_band band;
1347 unsigned int bands_set = 0;
1347 1348
1348 mutex_lock(&cfg80211_mutex); 1349 mutex_lock(&cfg80211_mutex);
1349 for (band = 0; band < IEEE80211_NUM_BANDS; band++) { 1350 for (band = 0; band < IEEE80211_NUM_BANDS; band++) {
1350 if (wiphy->bands[band]) 1351 if (!wiphy->bands[band])
1351 handle_band_custom(wiphy, band, regd); 1352 continue;
1353 handle_band_custom(wiphy, band, regd);
1354 bands_set++;
1352 } 1355 }
1353 mutex_unlock(&cfg80211_mutex); 1356 mutex_unlock(&cfg80211_mutex);
1357
1358 /*
1359 * no point in calling this if it won't have any effect
1360 * on your device's supportd bands.
1361 */
1362 WARN_ON(!bands_set);
1354} 1363}
1355EXPORT_SYMBOL(wiphy_apply_custom_regulatory); 1364EXPORT_SYMBOL(wiphy_apply_custom_regulatory);
1356 1365