summaryrefslogtreecommitdiffstats
path: root/net/mac80211/iface.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2013-12-04 17:47:09 -0500
committerJohannes Berg <johannes.berg@intel.com>2013-12-16 05:29:48 -0500
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,
889 cancel_work_sync(&sdata->work); 889 cancel_work_sync(&sdata->work);
890 /* 890 /*
891 * When we get here, the interface is marked down. 891 * When we get here, the interface is marked down.
892 * Free the remaining keys, if there are any
893 * (shouldn't be, except maybe in WDS mode?)
892 * 894 *
893 * We need synchronize_rcu() to wait for the RX path in 895 * Force the key freeing to always synchronize_net()
894 * case it is using the interface and enqueuing frames 896 * to wait for the RX path in case it is using this
895 * at this very time on another CPU. 897 * interface enqueuing frames * at this very time on
898 * another CPU.
896 */ 899 */
897 synchronize_rcu(); 900 ieee80211_free_keys(sdata, true);
898
899 /*
900 * Free all remaining keys, there shouldn't be any,
901 * except maybe in WDS mode?
902 */
903 ieee80211_free_keys(sdata);
904 901
905 /* fall through */ 902 /* fall through */
906 case NL80211_IFTYPE_AP: 903 case NL80211_IFTYPE_AP:
@@ -1026,7 +1023,7 @@ static void ieee80211_teardown_sdata(struct ieee80211_sub_if_data *sdata)
1026 int i; 1023 int i;
1027 1024
1028 /* free extra data */ 1025 /* free extra data */
1029 ieee80211_free_keys(sdata); 1026 ieee80211_free_keys(sdata, false);
1030 1027
1031 ieee80211_debugfs_remove_netdev(sdata); 1028 ieee80211_debugfs_remove_netdev(sdata);
1032 1029