From: Eyal Shapira Date: Wed, 20 Jun 2012 10:10:14 +0000 (+0300) Subject: mac80211: fix cleanup if driver suspend callback fails X-Git-Tag: v3.6-rc1~125^2~57^2~1^2~96 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9ea4fa158f3a038d5be82ccc7e142f198233f059;p=profile%2Fivi%2Fkernel-adaptation-intel-automotive.git mac80211: fix cleanup if driver suspend callback fails 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 Signed-off-by: Eyal Shapira Signed-off-by: Johannes Berg --- diff --git a/net/mac80211/pm.c b/net/mac80211/pm.c index 98c128b..5c572e7 100644 --- a/net/mac80211/pm.c +++ b/net/mac80211/pm.c @@ -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);