Commit cc5f58ae authored by Lorenzo Bianconi's avatar Lorenzo Bianconi Committed by Felix Fietkau

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: default avatarLorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent eb7bd8d7
...@@ -247,6 +247,9 @@ void mt7615_init_txpower(struct mt7615_dev *dev, ...@@ -247,6 +247,9 @@ void mt7615_init_txpower(struct mt7615_dev *dev,
int index; int index;
index = mt7615_eeprom_get_power_index(dev, chan, j); index = mt7615_eeprom_get_power_index(dev, chan, j);
if (index < 0)
continue;
target_power = max(target_power, eep[index]); target_power = max(target_power, eep[index]);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment