aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-03-01 13:32:18 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-03-06 15:30:47 -0500
commit96c46546e28282a743b97f26e94c7565350898b7 (patch)
tree38a12aadd7c0fd3c30fafeae8f136d86881338a3 /net/mac80211
parent38968d096b9f497e7ec4590b6b80eb8679e3646a (diff)
mac80211: always insert key into list
Today I hit one of my new WARN_ONs in the mac80211 code because a key wasn't being freed correctly. After wondering for a while I finally tracked it to the fact that STA keys aren't added to the per-sdata key list correctly, they are supposed to always be on that list, not just for default keys. This patch fixes that. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211')
-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,
174{ 174{
175 int idx, defkey; 175 int idx, defkey;
176 176
177 if (new)
178 list_add(&new->list, &sdata->key_list);
179
177 if (sta) { 180 if (sta) {
178 rcu_assign_pointer(sta->key, new); 181 rcu_assign_pointer(sta->key, new);
179 } else { 182 } else {
@@ -190,9 +193,6 @@ static void __ieee80211_key_replace(struct ieee80211_sub_if_data *sdata,
190 ieee80211_set_default_key(sdata, -1); 193 ieee80211_set_default_key(sdata, -1);
191 194
192 rcu_assign_pointer(sdata->keys[idx], new); 195 rcu_assign_pointer(sdata->keys[idx], new);
193 if (new)
194 list_add(&new->list, &sdata->key_list);
195
196 if (defkey && new) 196 if (defkey && new)
197 ieee80211_set_default_key(sdata, new->conf.keyidx); 197 ieee80211_set_default_key(sdata, new->conf.keyidx);
198 } 198 }