From 39217ebb8a4e0e89b823887759e80e63f723ca2d Mon Sep 17 00:00:00 2001 From: Haoxiang Li Date: Tue, 2 Jun 2026 17:08:00 +0800 Subject: [PATCH] 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 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 0bac9edbfd0..957dff5fbb6 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);