On 2014-05-21 16:16, Rajkumar Manoharan wrote: > On Wed, May 21, 2014 at 02:26:44PM +0200, Felix Fietkau wrote: >> On 2014-05-21 13:29, Rajkumar Manoharan wrote: >> > The keycache index is used to abort transmission for given station >> > when it goes to sleep state. But the commit "ath9k_hw: Abort transmission >> > for sleeping station" is not handling multi-key station. Fix that. >> > >> > Cc: Felix Fietkau <nbd@xxxxxxxxxxx> >> > Signed-off-by: Rajkumar Manoharan <rmanohar@xxxxxxxxxxxxxxxx> >> > --- >> > drivers/net/wireless/ath/ath9k/ath9k.h | 1 + >> > drivers/net/wireless/ath/ath9k/main.c | 52 +++++++++++++++++++++++++++------- >> > 2 files changed, 42 insertions(+), 11 deletions(-) >> > >> > @@ -1610,11 +1626,25 @@ static int ath9k_set_key(struct ieee80211_hw *hw, >> > key->flags |= IEEE80211_KEY_FLAG_SW_MGMT_TX; >> > ret = 0; >> > } >> > + if (an && key->hw_key_idx) { >> > + for (i = 0; i < ARRAY_SIZE(an->key_idx); i++) { >> > + if (an->key_idx[i]) >> > + continue; >> > + an->key_idx[i] = key->hw_key_idx; >> I think this should be moved inside the ret >= 0 test. > Since key->hw_key_idx is valid only when ret > 0, this change is moved > out of ret check to avoid additional indentation. That's my point. key->hw_key_idx is valid only when ret >= 0, are you sure that it's always zero before attempting to set it in hw? Not sure if a key can be disabled from mac80211 and then enabled again, but that's one scenario I can come up with, where hw_key_idx might be stale. It might be a good idea to initialize it to zero if adding the key failed (and also when disabling it). - Felix -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html