Skip to content

Commit

Permalink
mac80211: fix PS vs. scan race
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johannes Berg authored and John W. Linville committed May 6, 2009
1 parent 0e41f71 commit d5edaed
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions net/mac80211/mlme.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 +
Expand Down

0 comments on commit d5edaed

Please sign in to comment.