2019-07-12 06:22:01

by Felix Fietkau

[permalink] [raw]
Subject: [PATCH 3/4] 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 <[email protected]>
---
drivers/net/wireless/mediatek/mt76/mt7615/mac.c | 3 +++
1 file changed, 3 insertions(+)

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--;
}

--
2.17.0