From: Dmitry Shmidt Date: Mon, 19 Dec 2011 20:32:21 +0000 (-0800) Subject: wireless: Protect regdomain change by mutex X-Git-Tag: v3.3-rc1~182^2~21^2~54 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cee0bec58a922976a5f4d70081a3b2fd73e108e9;p=profile%2Fcommon%2Fkernel-common.git wireless: Protect regdomain change by mutex Signed-off-by: Dmitry Shmidt Signed-off-by: John W. Linville --- diff --git a/net/wireless/reg.c b/net/wireless/reg.c index c45c8b7..58d3937 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c @@ -1830,6 +1830,7 @@ static void restore_custom_reg_settings(struct wiphy *wiphy) 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); @@ -1881,6 +1882,8 @@ 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]; list_for_each_entry(rdev, &cfg80211_rdev_list, list) { if (rdev->wiphy.flags & WIPHY_FLAG_CUSTOM_REGULATORY) @@ -1890,7 +1893,7 @@ static void restore_regulatory_settings(bool reset_user) mutex_unlock(®_mutex); mutex_unlock(&cfg80211_mutex); - regulatory_hint_core(cfg80211_regdomain->alpha2); + regulatory_hint_core(world_alpha2); /* * This restores the ieee80211_regdom module parameter