Skip to content

Commit

Permalink
ath10k: fix arvif->wep_keys clearing
Browse files Browse the repository at this point in the history
The variable should be cleared regardless of
whether there's a peer associated with the key or
not.

This fixes case when user first associates with 2
WEP keys and then disconnects and connects with 1
WEP key. This resulted in WEP key count being 2 in
the driver leading to default keyidx fixup
failure.

Tested-by: Bartosz Markowski <bartosz.markowski@tieto.com>
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
  • Loading branch information
Michal Kazior authored and Kalle Valo committed Apr 9, 2015
1 parent 5d5c8ec commit 7c8cc7e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions drivers/net/wireless/ath/ath10k/mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -4720,6 +4720,13 @@ static int ath10k_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,

key->hw_key_idx = key->keyidx;

if (is_wep) {
if (cmd == SET_KEY)
arvif->wep_keys[key->keyidx] = key;
else
arvif->wep_keys[key->keyidx] = NULL;
}

/* the peer should not disappear in mid-way (unless FW goes awry) since
* we already hold conf_mutex. we just make sure its there now. */
spin_lock_bh(&ar->data_lock);
Expand All @@ -4745,11 +4752,6 @@ static int ath10k_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
flags |= WMI_KEY_GROUP;

if (is_wep) {
if (cmd == SET_KEY)
arvif->wep_keys[key->keyidx] = key;
else
arvif->wep_keys[key->keyidx] = NULL;

if (cmd == DISABLE_KEY)
ath10k_clear_vdev_key(arvif, key);

Expand Down

0 comments on commit 7c8cc7e

Please sign in to comment.