Skip to content

Commit

Permalink
cfg80211: protect first access of last_request on 11d hint under mutex
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Luis R. Rodriguez authored and John W. Linville committed Feb 27, 2009
1 parent 806a9e3 commit d335fe6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions net/wireless/reg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1261,11 +1261,13 @@ void regulatory_hint_11d(struct wiphy *wiphy,
u32 checksum = 0;
enum environment_cap env = ENVIRON_ANY;

if (!last_request)
return;

mutex_lock(&cfg80211_mutex);

if (unlikely(!last_request)) {
mutex_unlock(&cfg80211_mutex);
return;
}

/* IE len must be evenly divisible by 2 */
if (country_ie_len & 0x01)
goto out;
Expand Down

0 comments on commit d335fe6

Please sign in to comment.