summaryrefslogtreecommitdiffstats
path: root/net/mac80211/key.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2013-12-04 23:05:45 +0100
committerJohannes Berg <johannes.berg@intel.com>2013-12-16 11:29:46 +0100
commitc87820784454bbf7fc63a9e7d9c36762a46f393c (patch)
tree2b46b2dded299efa1f07e41cb9ce8ac1750a0a6c /net/mac80211/key.c
parentd34ba2168a3c10e7301cca06069c39865b4c3ec6 (diff)
downloadlinux-c87820784454bbf7fc63a9e7d9c36762a46f393c.tar.gz
linux-c87820784454bbf7fc63a9e7d9c36762a46f393c.tar.bz2
linux-c87820784454bbf7fc63a9e7d9c36762a46f393c.zip
mac80211: move synchronize_net() before sta key removal
There's no reason to do this inside the sta key removal since the keys can only be reached through the sta (and not by the driver at all) so once the sta can no longer be reached, the keys are safe. This will allow further optimisation opportunities with multiple stations. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/key.c')
-rw-r--r--net/mac80211/key.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/net/mac80211/key.c b/net/mac80211/key.c
index e568d98167d0..12e61543a37c 100644
--- a/net/mac80211/key.c
+++ b/net/mac80211/key.c
@@ -628,8 +628,7 @@ void ieee80211_free_keys(struct ieee80211_sub_if_data *sdata)
void ieee80211_free_sta_keys(struct ieee80211_local *local,
struct sta_info *sta)
{
- struct ieee80211_key *key, *tmp;
- LIST_HEAD(keys);
+ struct ieee80211_key *key;
int i;
mutex_lock(&local->key_mtx);
@@ -640,7 +639,7 @@ void ieee80211_free_sta_keys(struct ieee80211_local *local,
ieee80211_key_replace(key->sdata, key->sta,
key->conf.flags & IEEE80211_KEY_FLAG_PAIRWISE,
key, NULL);
- list_add(&key->list, &keys);
+ __ieee80211_key_destroy(key, true);
}
for (i = 0; i < NUM_DEFAULT_KEYS; i++) {
@@ -650,17 +649,8 @@ void ieee80211_free_sta_keys(struct ieee80211_local *local,
ieee80211_key_replace(key->sdata, key->sta,
key->conf.flags & IEEE80211_KEY_FLAG_PAIRWISE,
key, NULL);
- list_add(&key->list, &keys);
- }
-
- /*
- * NB: the station code relies on this being
- * done even if there aren't any keys
- */
- synchronize_net();
-
- list_for_each_entry_safe(key, tmp, &keys, list)
__ieee80211_key_destroy(key, true);
+ }
mutex_unlock(&local->key_mtx);
}