diff options
author | Lorenzo Bianconi <lorenzo@kernel.org> | 2020-05-02 01:16:10 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2020-05-12 19:52:34 +0200 |
commit | cc5f58aee180f1f8dbdbc136ecb3cdd190b29068 (patch) | |
tree | be7eab3f13d7086abac9ca943442c19b969639c3 /drivers | |
parent | eb7bd8d7fb727dcdbf4b1c145bba1169bc3c2d4a (diff) |
mt76: mt7615: check return value of mt7615_eeprom_get_power_index
mt7615_eeprom_get_power_index can return negative error value.
Check mt7615_eeprom_get_power_index return value before using it
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mt7615/init.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/init.c b/drivers/net/wireless/mediatek/mt76/mt7615/init.c index 81294bb2b06b..d831d647d237 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/init.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/init.c @@ -247,6 +247,9 @@ void mt7615_init_txpower(struct mt7615_dev *dev, int index; index = mt7615_eeprom_get_power_index(dev, chan, j); + if (index < 0) + continue; + target_power = max(target_power, eep[index]); } |