Skip to content

Commit 77244aa

Browse files
GTLin08henrikbrixandersen
authored andcommitted
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 <[email protected]>
1 parent ca371d6 commit 77244aa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpio/gpio_ite_it8xxx2_v2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ static void gpio_ite_isr(const void *arg)
380380
uint8_t num_pins = gpio_config->num_pins;
381381
uint8_t pin;
382382

383-
for (pin = 0; pin <= num_pins; pin++) {
383+
for (pin = 0; pin < num_pins; pin++) {
384384
if (irq == gpio_config->gpio_irq[pin]) {
385385
volatile uint8_t *reg_base =
386386
(uint8_t *)gpio_config->wuc_base[pin];

0 commit comments

Comments
 (0)