[MAC80211]: remove krefs for keys
authorJohannes Berg <johannes@sipsolutions.net>
Tue, 28 Aug 2007 21:01:54 +0000 (17:01 -0400)
committerDavid S. Miller <davem@sunset.davemloft.net>
Wed, 10 Oct 2007 23:48:51 +0000 (16:48 -0700)
they aren't really refcounted anyway

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Acked-by: Michael Wu <flamingice@sourmilk.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/mac80211/ieee80211_key.h
net/mac80211/key.c

index 1b5e539c678f9815327f602a186b895c60685da6..58e19253082658a3223696b591a04a593f9ab3e8 100644 (file)
@@ -11,7 +11,7 @@
 #define IEEE80211_KEY_H
 
 #include <linux/types.h>
-#include <linux/kref.h>
+#include <linux/list.h>
 #include <linux/crypto.h>
 #include <net/mac80211.h>
 
@@ -42,8 +42,6 @@
 #define NUM_RX_DATA_QUEUES 17
 
 struct ieee80211_key {
-       struct kref kref;
-
        union {
                struct {
                        /* last used TSC */
index 92d994f090b6b3187d87a9fe262de06953fd10d7..843d1577f00fc1f9cf7a31097b5b08e501a34e09 100644 (file)
@@ -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);
-}