summaryrefslogtreecommitdiff
path: root/net/mac80211/iface.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2013-12-04 23:47:09 +0100
committerJohannes Berg <johannes.berg@intel.com>2013-12-16 11:29:48 +0100
commit7907c7d33c3733b2265dadc6385fe028af72b4c7 (patch)
tree820eefc2cecdc675d9346f46e438a19318814ea0 /net/mac80211/iface.c
parente716251d776ce92eb5169522f565ada3deed2a2a (diff)
mac80211: free all AP/VLAN keys at once
When the AP interface is stopped, free all AP and VLAN keys at once to only require synchronize_net() once. Since that does synchronize_net(), also move two such calls into the function (using the new force_synchronize parameter) to avoid doing it twice. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/iface.c')
-rw-r--r--net/mac80211/iface.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 687d4eacd6ff..3d2168c3269e 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -889,18 +889,15 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
cancel_work_sync(&sdata->work);
/*
* When we get here, the interface is marked down.
+ * Free the remaining keys, if there are any
+ * (shouldn't be, except maybe in WDS mode?)
*
- * We need synchronize_rcu() to wait for the RX path in
- * case it is using the interface and enqueuing frames
- * at this very time on another CPU.
+ * Force the key freeing to always synchronize_net()
+ * to wait for the RX path in case it is using this
+ * interface enqueuing frames * at this very time on
+ * another CPU.
*/
- synchronize_rcu();
-
- /*
- * Free all remaining keys, there shouldn't be any,
- * except maybe in WDS mode?
- */
- ieee80211_free_keys(sdata);
+ ieee80211_free_keys(sdata, true);
/* fall through */
case NL80211_IFTYPE_AP:
@@ -1026,7 +1023,7 @@ static void ieee80211_teardown_sdata(struct ieee80211_sub_if_data *sdata)
int i;
/* free extra data */
- ieee80211_free_keys(sdata);
+ ieee80211_free_keys(sdata, false);
ieee80211_debugfs_remove_netdev(sdata);