From 8f37171a6243a8370211a1e86d58be683ccf01f0 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Tue, 28 Aug 2007 17:01:54 -0400 Subject: [MAC80211]: remove krefs for keys they aren't really refcounted anyway Signed-off-by: Johannes Berg Acked-by: Michael Wu Signed-off-by: John W. Linville Signed-off-by: David S. Miller --- net/mac80211/key.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'net/mac80211/key.c') diff --git a/net/mac80211/key.c b/net/mac80211/key.c index 92d994f090b6..843d1577f00f 100644 --- a/net/mac80211/key.c +++ b/net/mac80211/key.c @@ -21,23 +21,16 @@ struct ieee80211_key *ieee80211_key_alloc(struct ieee80211_sub_if_data *sdata, key = kzalloc(sizeof(struct ieee80211_key) + key_len, flags); if (!key) return NULL; - kref_init(&key->kref); return key; } -static void ieee80211_key_release(struct kref *kref) +void ieee80211_key_free(struct ieee80211_key *key) { - struct ieee80211_key *key; + if (!key) + return; - key = container_of(kref, struct ieee80211_key, kref); if (key->conf.alg == ALG_CCMP) ieee80211_aes_key_free(key->u.ccmp.tfm); ieee80211_debugfs_key_remove(key); kfree(key); } - -void ieee80211_key_free(struct ieee80211_key *key) -{ - if (key) - kref_put(&key->kref, ieee80211_key_release); -} -- cgit v1.2.3