aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDmitry Shmidt <dimitrysh@google.com>2011-12-19 15:32:21 -0500
committerJohn W. Linville <linville@tuxdriver.com>2012-01-04 14:30:39 -0500
commitcee0bec58a922976a5f4d70081a3b2fd73e108e9 (patch)
tree8eab2a655bfb1f210e2e9682ded92a54d35b426c /net
parentb423db5b356749e3e39faad607d387cd4c1a9d30 (diff)
wireless: Protect regdomain change by mutex
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r--net/wireless/reg.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index c45c8b772ddd..58d393766035 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -1830,6 +1830,7 @@ static void restore_custom_reg_settings(struct wiphy *wiphy)
1830static void restore_regulatory_settings(bool reset_user) 1830static void restore_regulatory_settings(bool reset_user)
1831{ 1831{
1832 char alpha2[2]; 1832 char alpha2[2];
1833 char world_alpha2[2];
1833 struct reg_beacon *reg_beacon, *btmp; 1834 struct reg_beacon *reg_beacon, *btmp;
1834 struct regulatory_request *reg_request, *tmp; 1835 struct regulatory_request *reg_request, *tmp;
1835 LIST_HEAD(tmp_reg_req_list); 1836 LIST_HEAD(tmp_reg_req_list);
@@ -1881,6 +1882,8 @@ static void restore_regulatory_settings(bool reset_user)
1881 1882
1882 /* First restore to the basic regulatory settings */ 1883 /* First restore to the basic regulatory settings */
1883 cfg80211_regdomain = cfg80211_world_regdom; 1884 cfg80211_regdomain = cfg80211_world_regdom;
1885 world_alpha2[0] = cfg80211_regdomain->alpha2[0];
1886 world_alpha2[1] = cfg80211_regdomain->alpha2[1];
1884 1887
1885 list_for_each_entry(rdev, &cfg80211_rdev_list, list) { 1888 list_for_each_entry(rdev, &cfg80211_rdev_list, list) {
1886 if (rdev->wiphy.flags & WIPHY_FLAG_CUSTOM_REGULATORY) 1889 if (rdev->wiphy.flags & WIPHY_FLAG_CUSTOM_REGULATORY)
@@ -1890,7 +1893,7 @@ static void restore_regulatory_settings(bool reset_user)
1890 mutex_unlock(&reg_mutex); 1893 mutex_unlock(&reg_mutex);
1891 mutex_unlock(&cfg80211_mutex); 1894 mutex_unlock(&cfg80211_mutex);
1892 1895
1893 regulatory_hint_core(cfg80211_regdomain->alpha2); 1896 regulatory_hint_core(world_alpha2);
1894 1897
1895 /* 1898 /*
1896 * This restores the ieee80211_regdom module parameter 1899 * This restores the ieee80211_regdom module parameter