summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2019-07-11 21:34:25 +0200
committerFelix Fietkau <nbd@nbd.name>2019-09-05 17:42:29 +0200
commitf4635f66da8d2a1855fa0f9c6b2c1b342fdf527d (patch)
tree4c0726d264bf28957203fd9d6284fc8ac2e08eeb
parent1f5581dffe76e9fe2badafcc55030cbc345b02bd (diff)
mt76: mt7615: fix invalid fallback rates
Only decrement the rate index on duplicate rates if it is not already 0 Signed-off-by: Felix Fietkau <nbd@nbd.name>
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt7615/mac.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c
index fc98dabed594..b3e8ee06a783 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/mac.c
@@ -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--;
}