aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/reg.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/wireless/reg.c')
-rw-r--r--net/wireless/reg.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 6c1993d99902..3a734949769d 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -907,6 +907,7 @@ EXPORT_SYMBOL(freq_reg_info);
907int freq_reg_info(struct wiphy *wiphy, u32 center_freq, u32 *bandwidth, 907int freq_reg_info(struct wiphy *wiphy, u32 center_freq, u32 *bandwidth,
908 const struct ieee80211_reg_rule **reg_rule) 908 const struct ieee80211_reg_rule **reg_rule)
909{ 909{
910 assert_cfg80211_lock();
910 return freq_reg_info_regd(wiphy, center_freq, 911 return freq_reg_info_regd(wiphy, center_freq,
911 bandwidth, reg_rule, NULL); 912 bandwidth, reg_rule, NULL);
912} 913}
@@ -1176,6 +1177,8 @@ static void handle_channel_custom(struct wiphy *wiphy,
1176 struct ieee80211_supported_band *sband; 1177 struct ieee80211_supported_band *sband;
1177 struct ieee80211_channel *chan; 1178 struct ieee80211_channel *chan;
1178 1179
1180 assert_cfg80211_lock();
1181
1179 sband = wiphy->bands[band]; 1182 sband = wiphy->bands[band];
1180 BUG_ON(chan_idx >= sband->n_channels); 1183 BUG_ON(chan_idx >= sband->n_channels);
1181 chan = &sband->channels[chan_idx]; 1184 chan = &sband->channels[chan_idx];
@@ -1214,10 +1217,13 @@ void wiphy_apply_custom_regulatory(struct wiphy *wiphy,
1214 const struct ieee80211_regdomain *regd) 1217 const struct ieee80211_regdomain *regd)
1215{ 1218{
1216 enum ieee80211_band band; 1219 enum ieee80211_band band;
1220
1221 mutex_lock(&cfg80211_mutex);
1217 for (band = 0; band < IEEE80211_NUM_BANDS; band++) { 1222 for (band = 0; band < IEEE80211_NUM_BANDS; band++) {
1218 if (wiphy->bands[band]) 1223 if (wiphy->bands[band])
1219 handle_band_custom(wiphy, band, regd); 1224 handle_band_custom(wiphy, band, regd);
1220 } 1225 }
1226 mutex_unlock(&cfg80211_mutex);
1221} 1227}
1222EXPORT_SYMBOL(wiphy_apply_custom_regulatory); 1228EXPORT_SYMBOL(wiphy_apply_custom_regulatory);
1223 1229