From: Pontus Fuchs Date: Thu, 31 May 2012 10:34:47 +0000 (+0200) Subject: mac80211: Clear wowlan flag when drv_suspend returns failure X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=3b08cf6bd2763bfe9d04fad4d7de29ee7735cd76;p=linux-beck.git mac80211: Clear wowlan flag when drv_suspend returns failure drv_resume can get called without a prior call to drv_suspend. Consider the following steps: 1. Suspend is started but driver's drv_suspend returns error. 2. Suspend is aborted. local->wowlan flag is left set. 3. Interface is removed. 4. Suspend again. This time open_count is 0 so drv_suspend is not called and local->wowlan not cleared. 5. On resume ieee80211_reconfig will call drv_resume since local->wowlan is set. Signed-off-by: Pontus Fuchs Signed-off-by: John W. Linville --- diff --git a/net/mac80211/pm.c b/net/mac80211/pm.c index af1c4e26e965..98c128be3827 100644 --- a/net/mac80211/pm.c +++ b/net/mac80211/pm.c @@ -77,6 +77,7 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan) int err = drv_suspend(local, wowlan); if (err < 0) { local->quiescing = false; + local->wowlan = false; return err; } else if (err > 0) { WARN_ON(err != 1);