aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2007-08-28 17:01:54 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:48:51 -0400
commit8f37171a6243a8370211a1e86d58be683ccf01f0 (patch)
tree3ca7a5eeed89cbd9ea6d86ddffa0a30ed2b4a3c6 /net/mac80211
parent8f20fc24986a083228823d9b68adca20714b254e (diff)
[MAC80211]: remove krefs for keys
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>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/ieee80211_key.h4
-rw-r--r--net/mac80211/key.c13
2 files changed, 4 insertions, 13 deletions
diff --git a/net/mac80211/ieee80211_key.h b/net/mac80211/ieee80211_key.h
index 1b5e539c678f..58e192530826 100644
--- a/net/mac80211/ieee80211_key.h
+++ b/net/mac80211/ieee80211_key.h
@@ -11,7 +11,7 @@
11#define IEEE80211_KEY_H 11#define IEEE80211_KEY_H
12 12
13#include <linux/types.h> 13#include <linux/types.h>
14#include <linux/kref.h> 14#include <linux/list.h>
15#include <linux/crypto.h> 15#include <linux/crypto.h>
16#include <net/mac80211.h> 16#include <net/mac80211.h>
17 17
@@ -42,8 +42,6 @@
42#define NUM_RX_DATA_QUEUES 17 42#define NUM_RX_DATA_QUEUES 17
43 43
44struct ieee80211_key { 44struct ieee80211_key {
45 struct kref kref;
46
47 union { 45 union {
48 struct { 46 struct {
49 /* last used TSC */ 47 /* last used TSC */
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,
21 key = kzalloc(sizeof(struct ieee80211_key) + key_len, flags); 21 key = kzalloc(sizeof(struct ieee80211_key) + key_len, flags);
22 if (!key) 22 if (!key)
23 return NULL; 23 return NULL;
24 kref_init(&key->kref);
25 return key; 24 return key;
26} 25}
27 26
28static void ieee80211_key_release(struct kref *kref) 27void ieee80211_key_free(struct ieee80211_key *key)
29{ 28{
30 struct ieee80211_key *key; 29 if (!key)
30 return;
31 31
32 key = container_of(kref, struct ieee80211_key, kref);
33 if (key->conf.alg == ALG_CCMP) 32 if (key->conf.alg == ALG_CCMP)
34 ieee80211_aes_key_free(key->u.ccmp.tfm); 33 ieee80211_aes_key_free(key->u.ccmp.tfm);
35 ieee80211_debugfs_key_remove(key); 34 ieee80211_debugfs_key_remove(key);
36 kfree(key); 35 kfree(key);
37} 36}
38
39void ieee80211_key_free(struct ieee80211_key *key)
40{
41 if (key)
42 kref_put(&key->kref, ieee80211_key_release);
43}