Skip to content

Commit

Permalink
mac80211: fix cleanup if driver suspend callback fails
Browse files Browse the repository at this point in the history
In case the driver suspend callback fails, mac80211 is left
with stopped queues which prevents any further traffic as well
as all STAs are left marked with WLAN_STA_BLOCK_BA which will
cause any further ADDBA requests to be declined. Fix it by
undoing both before returning from __iee80211_suspend.

Reported-by: Vitaly Wool <vitalywool@gmail.com>
Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
Eyal Shapira authored and Johannes Berg committed Jun 20, 2012
1 parent 00e96de commit 9ea4fa1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions net/mac80211/pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,16 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
if (err < 0) {
local->quiescing = false;
local->wowlan = false;
if (hw->flags & IEEE80211_HW_AMPDU_AGGREGATION) {
mutex_lock(&local->sta_mtx);
list_for_each_entry(sta,
&local->sta_list, list) {
clear_sta_flag(sta, WLAN_STA_BLOCK_BA);
}
mutex_unlock(&local->sta_mtx);
}
ieee80211_wake_queues_by_reason(hw,
IEEE80211_QUEUE_STOP_REASON_SUSPEND);
return err;
} else if (err > 0) {
WARN_ON(err != 1);
Expand Down

0 comments on commit 9ea4fa1

Please sign in to comment.