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@xxxxxxxxxx> --- drivers/net/wireless/mediatek/mt76/mt7615/init.c | 3 +++ 1 file changed, 3 insertions(+) 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]); } -- 2.25.4