Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 203889
b: refs/heads/master
c: 32162a4
h: refs/heads/master
i:
  203887: c36bfc8
v: v3
  • Loading branch information
Jouni Malinen authored and John W. Linville committed Jul 27, 2010
1 parent dec1edd commit 0c73a3a
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1b2fb7dc71c1f8f97663c2da84fa1c8183588474
refs/heads/master: 32162a4dab0e6a4ca7f886a01173b5f9b80843be
6 changes: 3 additions & 3 deletions trunk/net/mac80211/cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ static int ieee80211_add_key(struct wiphy *wiphy, struct net_device *dev,
if (mac_addr) {
sta = sta_info_get_bss(sdata, mac_addr);
if (!sta) {
ieee80211_key_free(key);
ieee80211_key_free(sdata->local, key);
err = -ENOENT;
goto out_unlock;
}
Expand Down Expand Up @@ -192,7 +192,7 @@ static int ieee80211_del_key(struct wiphy *wiphy, struct net_device *dev,
goto out_unlock;

if (sta->key) {
ieee80211_key_free(sta->key);
ieee80211_key_free(sdata->local, sta->key);
WARN_ON(sta->key);
ret = 0;
}
Expand All @@ -205,7 +205,7 @@ static int ieee80211_del_key(struct wiphy *wiphy, struct net_device *dev,
goto out_unlock;
}

ieee80211_key_free(sdata->keys[key_idx]);
ieee80211_key_free(sdata->local, sdata->keys[key_idx]);
WARN_ON(sdata->keys[key_idx]);

ret = 0;
Expand Down
13 changes: 6 additions & 7 deletions trunk/net/mac80211/key.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,13 +323,15 @@ static void __ieee80211_key_destroy(struct ieee80211_key *key)
if (!key)
return;

ieee80211_key_disable_hw_accel(key);
if (key->local)
ieee80211_key_disable_hw_accel(key);

if (key->conf.alg == ALG_CCMP)
ieee80211_aes_key_free(key->u.ccmp.tfm);
if (key->conf.alg == ALG_AES_CMAC)
ieee80211_aes_cmac_key_free(key->u.aes_cmac.tfm);
ieee80211_debugfs_key_remove(key);
if (key->local)
ieee80211_debugfs_key_remove(key);

kfree(key);
}
Expand Down Expand Up @@ -410,15 +412,12 @@ static void __ieee80211_key_free(struct ieee80211_key *key)
__ieee80211_key_destroy(key);
}

void ieee80211_key_free(struct ieee80211_key *key)
void ieee80211_key_free(struct ieee80211_local *local,
struct ieee80211_key *key)
{
struct ieee80211_local *local;

if (!key)
return;

local = key->sdata->local;

mutex_lock(&local->key_mtx);
__ieee80211_key_free(key);
mutex_unlock(&local->key_mtx);
Expand Down
3 changes: 2 additions & 1 deletion trunk/net/mac80211/key.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ struct ieee80211_key *ieee80211_key_alloc(enum ieee80211_key_alg alg,
void ieee80211_key_link(struct ieee80211_key *key,
struct ieee80211_sub_if_data *sdata,
struct sta_info *sta);
void ieee80211_key_free(struct ieee80211_key *key);
void ieee80211_key_free(struct ieee80211_local *local,
struct ieee80211_key *key);
void ieee80211_set_default_key(struct ieee80211_sub_if_data *sdata, int idx);
void ieee80211_set_default_mgmt_key(struct ieee80211_sub_if_data *sdata,
int idx);
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/mac80211/sta_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ static int __must_check __sta_info_destroy(struct sta_info *sta)
return ret;

if (sta->key) {
ieee80211_key_free(sta->key);
ieee80211_key_free(local, sta->key);
WARN_ON(sta->key);
}

Expand Down

0 comments on commit 0c73a3a

Please sign in to comment.