aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless
diff options
context:
space:
mode:
Diffstat (limited to 'net/wireless')
-rw-r--r--net/wireless/reg.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 3fa247488f87..b522c46c4748 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -1412,16 +1412,13 @@ static void reg_process_hint(struct regulatory_request *reg_request)
1412 1412
1413 BUG_ON(!reg_request->alpha2); 1413 BUG_ON(!reg_request->alpha2);
1414 1414
1415 mutex_lock(&cfg80211_mutex);
1416 mutex_lock(&reg_mutex);
1417
1418 if (wiphy_idx_valid(reg_request->wiphy_idx)) 1415 if (wiphy_idx_valid(reg_request->wiphy_idx))
1419 wiphy = wiphy_idx_to_wiphy(reg_request->wiphy_idx); 1416 wiphy = wiphy_idx_to_wiphy(reg_request->wiphy_idx);
1420 1417
1421 if (reg_request->initiator == NL80211_REGDOM_SET_BY_DRIVER && 1418 if (reg_request->initiator == NL80211_REGDOM_SET_BY_DRIVER &&
1422 !wiphy) { 1419 !wiphy) {
1423 kfree(reg_request); 1420 kfree(reg_request);
1424 goto out; 1421 return;
1425 } 1422 }
1426 1423
1427 r = __regulatory_hint(wiphy, reg_request); 1424 r = __regulatory_hint(wiphy, reg_request);
@@ -1429,16 +1426,16 @@ static void reg_process_hint(struct regulatory_request *reg_request)
1429 if (r == -EALREADY && wiphy && 1426 if (r == -EALREADY && wiphy &&
1430 wiphy->flags & WIPHY_FLAG_STRICT_REGULATORY) 1427 wiphy->flags & WIPHY_FLAG_STRICT_REGULATORY)
1431 wiphy_update_regulatory(wiphy, initiator); 1428 wiphy_update_regulatory(wiphy, initiator);
1432out:
1433 mutex_unlock(&reg_mutex);
1434 mutex_unlock(&cfg80211_mutex);
1435} 1429}
1436 1430
1437/* Processes regulatory hints, this is all the NL80211_REGDOM_SET_BY_* */ 1431/* Processes regulatory hints, this is all the NL80211_REGDOM_SET_BY_* */
1438static void reg_process_pending_hints(void) 1432static void reg_process_pending_hints(void)
1439 { 1433{
1440 struct regulatory_request *reg_request; 1434 struct regulatory_request *reg_request;
1441 1435
1436 mutex_lock(&cfg80211_mutex);
1437 mutex_lock(&reg_mutex);
1438
1442 spin_lock(&reg_requests_lock); 1439 spin_lock(&reg_requests_lock);
1443 while (!list_empty(&reg_requests_list)) { 1440 while (!list_empty(&reg_requests_list)) {
1444 reg_request = list_first_entry(&reg_requests_list, 1441 reg_request = list_first_entry(&reg_requests_list,
@@ -1451,6 +1448,9 @@ static void reg_process_pending_hints(void)
1451 spin_lock(&reg_requests_lock); 1448 spin_lock(&reg_requests_lock);
1452 } 1449 }
1453 spin_unlock(&reg_requests_lock); 1450 spin_unlock(&reg_requests_lock);
1451
1452 mutex_unlock(&reg_mutex);
1453 mutex_unlock(&cfg80211_mutex);
1454} 1454}
1455 1455
1456/* Processes beacon hints -- this has nothing to do with country IEs */ 1456/* Processes beacon hints -- this has nothing to do with country IEs */