git: 50f02080ea94 - main - aw_gpio: Return the error when an interrupt cannot be mapped

From: Emmanuel Vadot <manu_at_FreeBSD.org>
Date: Fri, 13 Nov 2026 07:29:51 UTC
The branch main has been updated by manu:

URL: https://cgit.FreeBSD.org/src/commit/?id=50f02080ea94a786a4a9215175eb79c153be7901

commit 50f02080ea94a786a4a9215175eb79c153be7901
Author:     Emmanuel Vadot <manu@FreeBSD.org>
AuthorDate: 2026-11-13 06:48:11 +0000
Commit:     Emmanuel Vadot <manu@FreeBSD.org>
CommitDate: 2026-11-13 07:29:30 +0000

    aw_gpio: Return the error when an interrupt cannot be mapped
    
    aw_gpio_pic_map_intr() returned success without setting the interrupt
    source when aw_gpio_pic_map_gpio() failed, which happens for a pin that
    has no interrupt function or for an unsupported mode.  The caller then
    went on with an uninitialized pointer.  Return the error.
    
    Reported by:    llm-postcr
    Fixes:          0fe5379c6a99 ("arm: allwinner: Add GPIO Interrupt support")
---
 sys/arm/allwinner/aw_gpio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/arm/allwinner/aw_gpio.c b/sys/arm/allwinner/aw_gpio.c
index 8a223bc4fb47..901d0e8d4104 100644
--- a/sys/arm/allwinner/aw_gpio.c
+++ b/sys/arm/allwinner/aw_gpio.c
@@ -1413,7 +1413,7 @@ aw_gpio_pic_map_intr(device_t dev, struct intr_map_data *data,
 
 	if (err == 0)
 		*isrcp = &sc->gpio_pic_irqsrc[irq].isrc;
-	return (0);
+	return (err);
 }
 
 static int