diff options
| author | Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn> | 2026-06-02 09:08:00 +0000 |
|---|---|---|
| committer | Ahmad Khalifa <vexeduxr@FreeBSD.org> | 2026-06-14 16:51:04 +0000 |
| commit | 39217ebb8a4e0e89b823887759e80e63f723ca2d (patch) | |
| tree | 68496a0386adf6da2504e59ec45298972474dc83 | |
| parent | 746c374aa94b46712e6defb3ab56dd2d6ad8db64 (diff) | |
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
| -rw-r--r-- | sys/arm/allwinner/a10/a10_intc.c | 4 |
1 files 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); |
