summaryrefslogtreecommitdiffstats
path: root/net/wireless/reg.c
diff options
context:
space:
mode:
authorLuis R. Rodriguez <mcgrof@do-not-panic.com>2013-11-05 09:18:13 -0800
committerJohannes Berg <johannes.berg@intel.com>2013-11-25 20:51:28 +0100
commitdb0e066a986e025781dcd4c05dc4cf480ae884b6 (patch)
tree838bc7a9ae5d8eab4af33894e3ceb28c239c01a9 /net/wireless/reg.c
parent0e3802dbfe53bc27a6bf019d022d743349a8d67d (diff)
downloadop-kernel-dev-db0e066a986e025781dcd4c05dc4cf480ae884b6.zip
op-kernel-dev-db0e066a986e025781dcd4c05dc4cf480ae884b6.tar.gz
cfg80211: pass the last_request to __set_regdom()
last_request is RCU protected, since we're getting it on set_regdom() we might as well pass it to ensure the same request is being processed, otherwise there is a small race it could have changed. This makes processing of the request atomic. Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/reg.c')
-rw-r--r--net/wireless/reg.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 38c252f..ca11f31 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -2192,12 +2192,12 @@ static void print_regdomain_info(const struct ieee80211_regdomain *rd)
}
/* Takes ownership of rd only if it doesn't fail */
-static int __set_regdom(const struct ieee80211_regdomain *rd)
+static int __set_regdom(const struct ieee80211_regdomain *rd,
+ struct regulatory_request *lr)
{
const struct ieee80211_regdomain *regd;
const struct ieee80211_regdomain *intersected_rd = NULL;
struct wiphy *request_wiphy;
- struct regulatory_request *lr = get_last_request();
/* Some basic sanity checks first */
@@ -2323,7 +2323,7 @@ int set_regdom(const struct ieee80211_regdomain *rd)
lr = get_last_request();
/* Note that this doesn't update the wiphys, this is done below */
- r = __set_regdom(rd);
+ r = __set_regdom(rd, lr);
if (r) {
if (r == -EALREADY)
reg_set_request_processed();
OpenPOWER on IntegriCloud