From: Felix Fietkau Date: Sat, 27 Aug 2011 08:25:27 +0000 (+0200) Subject: ath9k: fix regression in sending aggregated packets X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=059ee09b99942bf64f4075196a7a2a992e64193d;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git ath9k: fix regression in sending aggregated packets The recent commit "ath9k: Send legacy rated frames as unaggregated" introduced a check to ensure that packets with non-MCS rates set in the rate series will not be aggregated. However, it failed to check if the rate series is valid before testing the flags, thus breaking aggregation for normal MCS-only packets if the last series is unset. Signed-off-by: Felix Fietkau Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c index 5e2982938ffc..ac393a6dbe77 100644 --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c @@ -582,7 +582,10 @@ static bool ath_lookup_legacy(struct ath_buf *bf) tx_info = IEEE80211_SKB_CB(skb); rates = tx_info->control.rates; - for (i = 3; i >= 0; i--) { + for (i = 0; i < 4; i++) { + if (!rates[i].count || rates[i].idx < 0) + break; + if (!(rates[i].flags & IEEE80211_TX_RC_MCS)) return true; }