aboutsummaryrefslogtreecommitdiffstats
path: root/package/mac80211/patches/300-pending_work.patch
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2012-09-14 13:37:30 +0000
committerFelix Fietkau <nbd@openwrt.org>2012-09-14 13:37:30 +0000
commitc68fd7b65dfc069bf196fcef934057bef552155c (patch)
treecf250ea6e96b4828ddaa10499901f5302b245b53 /package/mac80211/patches/300-pending_work.patch
parentf6d27b20a643e017e9c633e3679e105fd88e6bfe (diff)
downloadupstream-c68fd7b65dfc069bf196fcef934057bef552155c.tar.gz
upstream-c68fd7b65dfc069bf196fcef934057bef552155c.tar.bz2
upstream-c68fd7b65dfc069bf196fcef934057bef552155c.zip
mac80211: fix regdb locking issues
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@33398 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/mac80211/patches/300-pending_work.patch')
-rw-r--r--package/mac80211/patches/300-pending_work.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/package/mac80211/patches/300-pending_work.patch b/package/mac80211/patches/300-pending_work.patch
index 66f1abb63e..183a86221b 100644
--- a/package/mac80211/patches/300-pending_work.patch
+++ b/package/mac80211/patches/300-pending_work.patch
@@ -327,3 +327,38 @@
priv->tsf_high32 = 0;
priv->tsf_low32 = 0;
+--- a/net/wireless/reg.c
++++ b/net/wireless/reg.c
+@@ -352,6 +352,9 @@ static void reg_regdb_search(struct work
+ struct reg_regdb_search_request *request;
+ const struct ieee80211_regdomain *curdom, *regdom;
+ int i, r;
++ bool set_reg = false;
++
++ mutex_lock(&cfg80211_mutex);
+
+ mutex_lock(&reg_regdb_search_mutex);
+ while (!list_empty(&reg_regdb_search_list)) {
+@@ -367,9 +370,7 @@ static void reg_regdb_search(struct work
+ r = reg_copy_regd(&regdom, curdom);
+ if (r)
+ break;
+- mutex_lock(&cfg80211_mutex);
+- set_regdom(regdom);
+- mutex_unlock(&cfg80211_mutex);
++ set_reg = true;
+ break;
+ }
+ }
+@@ -377,6 +378,11 @@ static void reg_regdb_search(struct work
+ kfree(request);
+ }
+ mutex_unlock(&reg_regdb_search_mutex);
++
++ if (set_reg)
++ set_regdom(regdom);
++
++ mutex_unlock(&cfg80211_mutex);
+ }
+
+ static DECLARE_WORK(reg_regdb_work, reg_regdb_search);