diff options
author | Johannes Berg <johannes.berg@intel.com> | 2013-03-06 16:53:52 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-03-11 09:16:41 -0400 |
commit | 79cf2dfa362f3e6368ad8ecb10aa82b39678fedc (patch) | |
tree | a31ef2bc191d189378fc3520df7e8d303b65c0d1 /net/mac80211/key.h | |
parent | 3d5839b6aa6bbf26c04e885956109d1995d01fe2 (diff) |
mac80211: clean up key freeing a bit
When a key is allocated but not really added, there's no
need to go through the entire teardown process. Also, if
adding a key fails, ieee80211_key_link() can take care of
freeing it instead of the (only) caller.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/key.h')
-rw-r--r-- | net/mac80211/key.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/net/mac80211/key.h b/net/mac80211/key.h index 2a682d81cee9..8ef56cdfe3d7 100644 --- a/net/mac80211/key.h +++ b/net/mac80211/key.h | |||
@@ -129,14 +129,13 @@ struct ieee80211_key *ieee80211_key_alloc(u32 cipher, int idx, size_t key_len, | |||
129 | size_t seq_len, const u8 *seq); | 129 | size_t seq_len, const u8 *seq); |
130 | /* | 130 | /* |
131 | * Insert a key into data structures (sdata, sta if necessary) | 131 | * Insert a key into data structures (sdata, sta if necessary) |
132 | * to make it used, free old key. | 132 | * to make it used, free old key. On failure, also free the new key. |
133 | */ | 133 | */ |
134 | int __must_check ieee80211_key_link(struct ieee80211_key *key, | 134 | int ieee80211_key_link(struct ieee80211_key *key, |
135 | struct ieee80211_sub_if_data *sdata, | 135 | struct ieee80211_sub_if_data *sdata, |
136 | struct sta_info *sta); | 136 | struct sta_info *sta); |
137 | void __ieee80211_key_free(struct ieee80211_key *key, bool delay_tailroom); | 137 | void __ieee80211_key_free(struct ieee80211_key *key, bool delay_tailroom); |
138 | void ieee80211_key_free(struct ieee80211_local *local, | 138 | void ieee80211_key_free_unused(struct ieee80211_key *key); |
139 | struct ieee80211_key *key); | ||
140 | void ieee80211_set_default_key(struct ieee80211_sub_if_data *sdata, int idx, | 139 | void ieee80211_set_default_key(struct ieee80211_sub_if_data *sdata, int idx, |
141 | bool uni, bool multi); | 140 | bool uni, bool multi); |
142 | void ieee80211_set_default_mgmt_key(struct ieee80211_sub_if_data *sdata, | 141 | void ieee80211_set_default_mgmt_key(struct ieee80211_sub_if_data *sdata, |