summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-04-22 23:02:51 +0200
committerJohn W. Linville <linville@tuxdriver.com>2009-05-04 16:29:45 -0400
commitffc6efddf4748a88b176663a812a5ccb5968ace2 (patch)
tree11124589e2ccde9dee19168e71798e2dd9e33419 /net
parent55579cd83dec00f2c1d239c5f3b79db71692b1f7 (diff)
mac80211: fix PS vs. scan race
When somebody changes the PS parameters while scanning is in progress, we enable PS -- during the scan. This is clearly not desirable, and we can just abort enabling PS when scanning since when the scan finishes it will be taken care of. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Reviewed-by: Kalle Valo <kalle.valo@iki.fi> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/mlme.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 3610c11286bc..2029b71eb879 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -487,6 +487,13 @@ static void ieee80211_enable_ps(struct ieee80211_local *local,
{
struct ieee80211_conf *conf = &local->hw.conf;
+ /*
+ * If we are scanning right now then the parameters will
+ * take effect when scan finishes.
+ */
+ if (local->hw_scanning || local->sw_scanning)
+ return;
+
if (conf->dynamic_ps_timeout > 0 &&
!(local->hw.flags & IEEE80211_HW_SUPPORTS_DYNAMIC_PS)) {
mod_timer(&local->dynamic_ps_timer, jiffies +