aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2013-04-17 05:26:40 -0400
committerJohannes Berg <johannes.berg@intel.com>2013-04-17 05:40:39 -0400
commitb20d34c458bc2bbd0a4624f2933581e01e72d875 (patch)
treea0bdd3b62f4f06c2fffc0d62cf7f6c58f286fdb5 /net/mac80211
parent991fec091061b901e4fdcc8af4fd25d24a5a7bab (diff)
mac80211: fix station entry leak/warning while suspending
Since Stanislaw's patches, when suspending while connected, cfg80211 will disconnect. This causes the AP station to be removed, which uses call_rcu() to clean up. Due to needing process context, this queues a work struct on the mac80211 workqueue. This will warn and fail when already suspended, which can happen if the rcu call doesn't happen quickly. To fix this, replace the synchronize_net() which is really just synchronize_rcu_expedited() with rcu_barrier(), which unlike synchronize_rcu() waits until RCU callback have run and thus avoids this issue. In theory, this can even happen without Stanislaw's change to disconnect on suspend since userspace might disconnect just before suspending, though then it's unlikely that the call_rcu() will be delayed long enough. Cc: stable@vger.kernel.org [3.7+] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/pm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/mac80211/pm.c b/net/mac80211/pm.c
index d1c021b62fe5..4431f0ffe157 100644
--- a/net/mac80211/pm.c
+++ b/net/mac80211/pm.c
@@ -37,8 +37,8 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
37 IEEE80211_MAX_QUEUE_MAP, 37 IEEE80211_MAX_QUEUE_MAP,
38 IEEE80211_QUEUE_STOP_REASON_SUSPEND); 38 IEEE80211_QUEUE_STOP_REASON_SUSPEND);
39 39
40 /* flush out all packets */ 40 /* flush out all packets and station cleanup call_rcu()s */
41 synchronize_net(); 41 rcu_barrier();
42 42
43 ieee80211_flush_queues(local, NULL); 43 ieee80211_flush_queues(local, NULL);
44 44