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
This commit is contained in:
committed by
Ahmad Khalifa
parent
746c374aa9
commit
39217ebb8a
@@ -330,7 +330,7 @@ a10_aintc_attach(device_t dev)
|
|||||||
&rid, RF_ACTIVE);
|
&rid, RF_ACTIVE);
|
||||||
if (!sc->aintc_res) {
|
if (!sc->aintc_res) {
|
||||||
device_printf(dev, "could not allocate resource\n");
|
device_printf(dev, "could not allocate resource\n");
|
||||||
goto error;
|
return (ENXIO);
|
||||||
}
|
}
|
||||||
|
|
||||||
sc->aintc_bst = rman_get_bustag(sc->aintc_res);
|
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) {
|
if (a10_intr_pic_attach(sc) != 0) {
|
||||||
device_printf(dev, "could not attach PIC\n");
|
device_printf(dev, "could not attach PIC\n");
|
||||||
return (ENXIO);
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
|
|||||||
Reference in New Issue
Block a user