mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
mt76: add a bound check in mt76_calculate_default_rate()
basic_rate could be 0 ie. hidden AP. Always pick the lowest rate for such cases. Fixes: 75fb2e62d444 (mt76: add mt76_default_basic_rate more devices can rely on) Signed-off-by: Ryder Lee <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
@@ -1356,6 +1356,10 @@ u16 mt76_calculate_default_rate(struct mt76_phy *phy, int rateidx)
|
||||
if (phy->chandef.chan->band == NL80211_BAND_5GHZ)
|
||||
offset = 4;
|
||||
|
||||
/* pick the lowest rate for hidden nodes */
|
||||
if (rateidx < 0)
|
||||
rateidx = 0;
|
||||
|
||||
rate = &mt76_rates[offset + rateidx];
|
||||
|
||||
return rate->hw_value;
|
||||
|
||||
Reference in New Issue
Block a user