diff options
author | Johannes Berg <johannes.berg@intel.com> | 2014-12-17 07:55:49 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2014-12-17 08:00:17 -0500 |
commit | 28a9bc68124c319b2b3dc861e80828a8865fd1ba (patch) | |
tree | 442256aed3ae236fd4cdcdaa63a8ade6805c49af /net | |
parent | 185076d6db7b0320fd7669732923179f9a4d068b (diff) |
mac80211: free management frame keys when removing station
When writing the code to allow per-station GTKs, I neglected to
take into account the management frame keys (index 4 and 5) when
freeing the station and only added code to free the first four
data frame keys.
Fix this by iterating the array of keys over the right length.
Cc: stable@vger.kernel.org
Fixes: e31b82136d1a ("cfg80211/mac80211: allow per-station GTKs")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/mac80211/key.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/mac80211/key.c b/net/mac80211/key.c index 434a91ad12c8..0bb7038121ac 100644 --- a/net/mac80211/key.c +++ b/net/mac80211/key.c | |||
@@ -656,7 +656,7 @@ void ieee80211_free_sta_keys(struct ieee80211_local *local, | |||
656 | int i; | 656 | int i; |
657 | 657 | ||
658 | mutex_lock(&local->key_mtx); | 658 | mutex_lock(&local->key_mtx); |
659 | for (i = 0; i < NUM_DEFAULT_KEYS; i++) { | 659 | for (i = 0; i < ARRAY_SIZE(sta->gtk); i++) { |
660 | key = key_mtx_dereference(local, sta->gtk[i]); | 660 | key = key_mtx_dereference(local, sta->gtk[i]); |
661 | if (!key) | 661 | if (!key) |
662 | continue; | 662 | continue; |