mt76: mt7603: fix invalid fallback rates
authorFelix Fietkau <nbd@nbd.name>
Fri, 12 Jul 2019 06:19:35 +0000 (08:19 +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/mt7603/mac.c

index 40db1cbc832d3152c5ee204b9973763ba61a26a6..81fb4276e7420ffced35669e92dc78fc0dd1c8b0 100644 (file)
@@ -639,6 +639,9 @@ void mt7603_wtbl_set_rates(struct mt7603_dev *dev, struct mt7603_sta *sta,
                            IEEE80211_TX_RC_40_MHZ_WIDTH)
                                continue;
 
+                       if (!rates[i].idx)
+                               continue;
+
                        rates[i].idx--;
                }