summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorDmitry Shmidt <dimitrysh@google.com>2011-12-19 12:32:21 -0800
committerVarun Colbert <vcolbert@nvidia.com>2012-01-19 16:15:33 -0800
commit59ea3404e1056b0084c50a30d6e1b60c7ea6955d (patch)
treeca70d49e57ff14bdf0d8a17f49865824b0c753e4 /net
parent3b718bdc14066d29cbd168380a125784f4fd56b5 (diff)
wireless: Protect regdomain change by mutex
cherry-pick 35047200c401cdd1bb43b5574270d1ac86a47937 from https://android.googlesource.com/kernel/common.git Change-Id: I23efd4bab367bf49f7aca34daa19904baf5b9170 Signed-off-by: Dmitry Shmidt <dimitrysh@google.com> Signed-off-by: Varun Wadekar <vwadekar@nvidia.com> Reviewed-on: http://git-master/r/75462 Reviewed-by: Automatic_Commit_Validation_User
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 1bc36d250baf..ca754451e768 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -1773,6 +1773,7 @@ static void restore_alpha2(char *alpha2, bool reset_user)
static void restore_regulatory_settings(bool reset_user)
{
char alpha2[2];
+ char world_alpha2[2];
struct reg_beacon *reg_beacon, *btmp;
struct regulatory_request *reg_request, *tmp;
LIST_HEAD(tmp_reg_req_list);
@@ -1823,11 +1824,13 @@ static void restore_regulatory_settings(bool reset_user)
/* First restore to the basic regulatory settings */
cfg80211_regdomain = cfg80211_world_regdom;
+ world_alpha2[0] = cfg80211_regdomain->alpha2[0];
+ world_alpha2[1] = cfg80211_regdomain->alpha2[1];
mutex_unlock(&reg_mutex);
mutex_unlock(&cfg80211_mutex);
- regulatory_hint_core(cfg80211_regdomain->alpha2);
+ regulatory_hint_core(world_alpha2);
/*
* This restores the ieee80211_regdom module parameter