aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJohannes Berg2013-04-16 07:32:26 -0500
committerGreg Kroah-Hartman2013-05-07 22:08:23 -0500
commit8aba4976abb99ae093cc8d74976164be487a93a5 (patch)
treeba3870199088ad17edb25040325f12babaa9b95a /net
parenta63d0364cc416e40a3a4f8d67d73354c91152a7d (diff)
downloadkernel-video-8aba4976abb99ae093cc8d74976164be487a93a5.tar.gz
kernel-video-8aba4976abb99ae093cc8d74976164be487a93a5.tar.xz
kernel-video-8aba4976abb99ae093cc8d74976164be487a93a5.zip
wireless: regulatory: fix channel disabling race condition
commit 990de49f74e772b6db5208457b7aa712a5f4db86 upstream. When a full scan 2.4 and 5 GHz scan is scheduled, but then the 2.4 GHz part of the scan disables a 5.2 GHz channel due to, e.g. receiving country or frequency information, that 5.2 GHz channel might already be in the list of channels to scan next. Then, when the driver checks if it should do a passive scan, that will return false and attempt an active scan. This is not only wrong but can also lead to the iwlwifi device firmware crashing since it checks regulatory as well. Fix this by not setting the channel flags to just disabled but rather OR'ing in the disabled flag. That way, even if the race happens, the channel will be scanned passively which is still (mostly) correct. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net')
-rw-r--r--net/wireless/reg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 82c4fc7c994..91ef82b4f94 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -883,7 +883,7 @@ static void handle_channel(struct wiphy *wiphy,
883 return; 883 return;
884 884
885 REG_DBG_PRINT("Disabling freq %d MHz\n", chan->center_freq); 885 REG_DBG_PRINT("Disabling freq %d MHz\n", chan->center_freq);
886 chan->flags = IEEE80211_CHAN_DISABLED; 886 chan->flags |= IEEE80211_CHAN_DISABLED;
887 return; 887 return;
888 } 888 }
889 889