aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJohannes Berg2013-04-17 04:26:40 -0500
committerGreg Kroah-Hartman2013-05-07 22:08:17 -0500
commitf3603003d7e5c71195606281a0bba4d2c087e9db (patch)
treed586e259a63accb299a8a51e0ad6f452824ad908 /net
parente03eb5f7fe183ba234e9b096a08ff2cb1d27e50b (diff)
downloadkernel-video-f3603003d7e5c71195606281a0bba4d2c087e9db.tar.gz
kernel-video-f3603003d7e5c71195606281a0bba4d2c087e9db.tar.xz
kernel-video-f3603003d7e5c71195606281a0bba4d2c087e9db.zip
mac80211: fix station entry leak/warning while suspending
commit b20d34c458bc2bbd0a4624f2933581e01e72d875 upstream. 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. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net')
-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 79a48f37d40..64619f418fd 100644
--- a/net/mac80211/pm.c
+++ b/net/mac80211/pm.c
@@ -52,8 +52,8 @@ int __ieee80211_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
52 ieee80211_stop_queues_by_reason(hw, 52 ieee80211_stop_queues_by_reason(hw,
53 IEEE80211_QUEUE_STOP_REASON_SUSPEND); 53 IEEE80211_QUEUE_STOP_REASON_SUSPEND);
54 54
55 /* flush out all packets */ 55 /* flush out all packets and station cleanup call_rcu()s */
56 synchronize_net(); 56 rcu_barrier();
57 57
58 drv_flush(local, false); 58 drv_flush(local, false);
59 59