git: 39217ebb8a4e - main - arm: allwinner: Fix A10 INTC MMIO resource cleanup

From: Ahmad Khalifa <vexeduxr_at_FreeBSD.org>
Date: Sun, 14 Jun 2026 16:52:12 UTC
The branch main has been updated by vexeduxr:

URL: https://cgit.FreeBSD.org/src/commit/?id=39217ebb8a4e0e89b823887759e80e63f723ca2d

commit 39217ebb8a4e0e89b823887759e80e63f723ca2d
Author:     Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
AuthorDate: 2026-06-02 09:08:00 +0000
Commit:     Ahmad Khalifa <vexeduxr@FreeBSD.org>
CommitDate: 2026-06-14 16:51:04 +0000

    arm: allwinner: Fix A10 INTC MMIO resource cleanup
    
    Do not jump to the resource release path when bus_alloc_resource_any()
    fails, since no MMIO resource was allocated. If a10_intr_pic_attach()
    fails after the MMIO resource has been allocated, release it before
    returning.
    
    Signed-off-by:  Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
    Reviewed-by:    vexeduxr
    Pull-Request:   https://github.com/freebsd/freebsd-src/pull/2253
---
 sys/arm/allwinner/a10/a10_intc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/arm/allwinner/a10/a10_intc.c b/sys/arm/allwinner/a10/a10_intc.c
index 0bac9edbfd08..957dff5fbb61 100644
--- a/sys/arm/allwinner/a10/a10_intc.c
+++ b/sys/arm/allwinner/a10/a10_intc.c
@@ -330,7 +330,7 @@ a10_aintc_attach(device_t dev)
 	    &rid, RF_ACTIVE);
 	if (!sc->aintc_res) {
 		device_printf(dev, "could not allocate resource\n");
-		goto error;
+		return (ENXIO);
 	}
 
 	sc->aintc_bst = rman_get_bustag(sc->aintc_res);
@@ -351,7 +351,7 @@ a10_aintc_attach(device_t dev)
 
 	if (a10_intr_pic_attach(sc) != 0) {
 		device_printf(dev, "could not attach PIC\n");
-		return (ENXIO);
+		goto error;
 	}
 
 	return (0);