ITE: drivers/gpio: Fix untrusted loop bound

The pin in the loop start counting from 0, so the condition of the
for loop should not be equal to num_pins.

Fixes #69118

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
This commit is contained in:
Tim Lin 2024-02-19 14:18:05 +08:00 committed by Henrik Brix Andersen
parent ca371d6890
commit 77244aae1d

View file

@ -380,7 +380,7 @@ static void gpio_ite_isr(const void *arg)
uint8_t num_pins = gpio_config->num_pins;
uint8_t pin;
for (pin = 0; pin <= num_pins; pin++) {
for (pin = 0; pin < num_pins; pin++) {
if (irq == gpio_config->gpio_irq[pin]) {
volatile uint8_t *reg_base =
(uint8_t *)gpio_config->wuc_base[pin];