mt76: mt7615: fix invalid fallback rates
authorFelix Fietkau <nbd@nbd.name>
Thu, 11 Jul 2019 19:34:25 +0000 (21:34 +0200)
committerFelix Fietkau <nbd@nbd.name>
Thu, 5 Sep 2019 15:42:29 +0000 (17:42 +0200)
Only decrement the rate index on duplicate rates if it is not already 0

Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7615/mac.c

index fc98dab..b3e8ee0 100644 (file)
@@ -503,6 +503,9 @@ void mt7615_mac_set_rates(struct mt7615_dev *dev, struct mt7615_sta *sta,
                             IEEE80211_TX_RC_160_MHZ_WIDTH))
                                continue;
 
+                       if (!rates[i].idx)
+                               continue;
+
                        rates[i].idx--;
                }