diff options
author | Luis R. Rodriguez <mcgrof@do-not-panic.com> | 2013-11-05 12:18:13 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-11-25 14:51:28 -0500 |
commit | db0e066a986e025781dcd4c05dc4cf480ae884b6 (patch) | |
tree | 838bc7a9ae5d8eab4af33894e3ceb28c239c01a9 /net/wireless/reg.c | |
parent | 0e3802dbfe53bc27a6bf019d022d743349a8d67d (diff) |
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.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c index 38c252f91086..ca11f31b3bec 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) | |||
2192 | } | 2192 | } |
2193 | 2193 | ||
2194 | /* Takes ownership of rd only if it doesn't fail */ | 2194 | /* Takes ownership of rd only if it doesn't fail */ |
2195 | static int __set_regdom(const struct ieee80211_regdomain *rd) | 2195 | static int __set_regdom(const struct ieee80211_regdomain *rd, |
2196 | struct regulatory_request *lr) | ||
2196 | { | 2197 | { |
2197 | const struct ieee80211_regdomain *regd; | 2198 | const struct ieee80211_regdomain *regd; |
2198 | const struct ieee80211_regdomain *intersected_rd = NULL; | 2199 | const struct ieee80211_regdomain *intersected_rd = NULL; |
2199 | struct wiphy *request_wiphy; | 2200 | struct wiphy *request_wiphy; |
2200 | struct regulatory_request *lr = get_last_request(); | ||
2201 | 2201 | ||
2202 | /* Some basic sanity checks first */ | 2202 | /* Some basic sanity checks first */ |
2203 | 2203 | ||
@@ -2323,7 +2323,7 @@ int set_regdom(const struct ieee80211_regdomain *rd) | |||
2323 | lr = get_last_request(); | 2323 | lr = get_last_request(); |
2324 | 2324 | ||
2325 | /* Note that this doesn't update the wiphys, this is done below */ | 2325 | /* Note that this doesn't update the wiphys, this is done below */ |
2326 | r = __set_regdom(rd); | 2326 | r = __set_regdom(rd, lr); |
2327 | if (r) { | 2327 | if (r) { |
2328 | if (r == -EALREADY) | 2328 | if (r == -EALREADY) |
2329 | reg_set_request_processed(); | 2329 | reg_set_request_processed(); |