diff options
author | Johannes Berg <johannes.berg@intel.com> | 2011-05-12 14:31:49 +0200 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-05-12 20:10:53 +0200 |
commit | 5c0c36412b2dc6b1e243c7e9115306fe286583b7 (patch) | |
tree | a189957b3a8e939d19da304541ba087f1264085a /net/mac80211/key.c | |
parent | mac80211: remove pointless mesh path timer RCU code (diff) | |
download | linux-5c0c36412b2dc6b1e243c7e9115306fe286583b7.tar.xz linux-5c0c36412b2dc6b1e243c7e9115306fe286583b7.zip |
mac80211: make key locking clearer
The code in ieee80211_del_key() doesn't acquire the
key_mtx properly when it dereferences the keys. It
turns out that isn't actually necessary since the
key_mtx itself seems to be redundant since all key
manipulations are done under the RTNL, but as long
as we have the key_mtx we should use it the right
way too.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/key.c')
-rw-r--r-- | net/mac80211/key.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/mac80211/key.c b/net/mac80211/key.c index b510721e3b3d..958832dd4f0a 100644 --- a/net/mac80211/key.c +++ b/net/mac80211/key.c @@ -471,8 +471,11 @@ int ieee80211_key_link(struct ieee80211_key *key, return ret; } -static void __ieee80211_key_free(struct ieee80211_key *key) +void __ieee80211_key_free(struct ieee80211_key *key) { + if (!key) + return; + /* * Replace key with nothingness if it was ever used. */ @@ -486,9 +489,6 @@ static void __ieee80211_key_free(struct ieee80211_key *key) void ieee80211_key_free(struct ieee80211_local *local, struct ieee80211_key *key) { - if (!key) - return; - mutex_lock(&local->key_mtx); __ieee80211_key_free(key); mutex_unlock(&local->key_mtx); |