From b9a378c1ca630ba72d19640e7dee2ec4aec971ea Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Thu, 17 Nov 2022 14:38:41 -0500 Subject: [PATCH] rp2040: Fix boundary check for max gpio pin Signed-off-by: Kevin O'Connor --- src/rp2040/gpio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rp2040/gpio.c b/src/rp2040/gpio.c index bac67d23..98e07789 100644 --- a/src/rp2040/gpio.c +++ b/src/rp2040/gpio.c @@ -48,7 +48,7 @@ mask_to_pin(uint32_t mask) struct gpio_out gpio_out_setup(uint8_t pin, uint8_t val) { - if (pin > 30) + if (pin >= 30) goto fail; struct gpio_out g = { .bit=1< 30) + if (pin >= 30) goto fail; struct gpio_in g = { .bit=1<