summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/key.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/mac80211/key.c b/net/mac80211/key.c
index 166d0f00d135..f91fb4092652 100644
--- a/net/mac80211/key.c
+++ b/net/mac80211/key.c
@@ -174,6 +174,9 @@ static void __ieee80211_key_replace(struct ieee80211_sub_if_data *sdata,
{
int idx, defkey;
+ if (new)
+ list_add(&new->list, &sdata->key_list);
+
if (sta) {
rcu_assign_pointer(sta->key, new);
} else {
@@ -190,9 +193,6 @@ static void __ieee80211_key_replace(struct ieee80211_sub_if_data *sdata,
ieee80211_set_default_key(sdata, -1);
rcu_assign_pointer(sdata->keys[idx], new);
- if (new)
- list_add(&new->list, &sdata->key_list);
-
if (defkey && new)
ieee80211_set_default_key(sdata, new->conf.keyidx);
}