diff options
author | Luis R. Rodriguez <lrodriguez@atheros.com> | 2009-02-21 00:04:27 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-02-27 14:52:56 -0500 |
commit | d335fe6391c2d86582cf71ef5773a161ee604608 (patch) | |
tree | 4a5af6c209c73fc16e54f71c3a0e2ba046f0fcf9 /net/wireless | |
parent | 806a9e39670be4f1f861c346ec102a79e81b90c3 (diff) |
cfg80211: protect first access of last_request on 11d hint under mutex
We were not protecting last_request there is a small possible race
between an 11d hint and another routine which calls reset_regdomains()
which can prevent a valid country IE from being processed. This is
not critical as it will still be procesed soon after but locking prior
to it is correct.
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless')
-rw-r--r-- | net/wireless/reg.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c index d44f3b5481ad..b47445219a48 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c | |||
@@ -1261,11 +1261,13 @@ void regulatory_hint_11d(struct wiphy *wiphy, | |||
1261 | u32 checksum = 0; | 1261 | u32 checksum = 0; |
1262 | enum environment_cap env = ENVIRON_ANY; | 1262 | enum environment_cap env = ENVIRON_ANY; |
1263 | 1263 | ||
1264 | if (!last_request) | ||
1265 | return; | ||
1266 | |||
1267 | mutex_lock(&cfg80211_mutex); | 1264 | mutex_lock(&cfg80211_mutex); |
1268 | 1265 | ||
1266 | if (unlikely(!last_request)) { | ||
1267 | mutex_unlock(&cfg80211_mutex); | ||
1268 | return; | ||
1269 | } | ||
1270 | |||
1269 | /* IE len must be evenly divisible by 2 */ | 1271 | /* IE len must be evenly divisible by 2 */ |
1270 | if (country_ie_len & 0x01) | 1272 | if (country_ie_len & 0x01) |
1271 | goto out; | 1273 | goto out; |