summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/ath/ath9k/xmit.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index 5e2982938ff..ac393a6dbe7 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;
}