[PATCH v3 11/14] irqchip/gic-v5: Release ITS MMIO region on DT probe failure

From: Sascha Bischoff

Date: Wed Nov 18 2026 - 12:36:58 EST


of_io_request_and_map() reserves the ITS configuration frame region.
If ITS initialisation fails after mapping it, the error path only
unmaps the registers and leaves the region reserved.

Keep the resource description and release the region on that path.

Fixes: 57d72196dfc85 ("irqchip/gic-v5: Add GICv5 ITS support")
Signed-off-by: Sascha Bischoff <sascha.bischoff@xxxxxxx>
Acked-by: Lorenzo Pieralisi <lpieralisi@xxxxxxxxxx>
---
drivers/irqchip/irq-gic-v5-its.c | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/drivers/irqchip/irq-gic-v5-its.c b/drivers/irqchip/irq-gic-v5-its.c
index e7db4449fe916..db13011ef6d93 100644
--- a/drivers/irqchip/irq-gic-v5-its.c
+++ b/drivers/irqchip/irq-gic-v5-its.c
@@ -1188,6 +1188,7 @@ static int __init gicv5_its_init_bases(void __iomem *its_base, struct fwnode_han
static int __init gicv5_its_init(struct device_node *node)
{
void __iomem *its_base;
+ struct resource res;
int ret, idx;

idx = of_property_match_string(node, "reg-names", "ns-config");
@@ -1196,6 +1197,11 @@ static int __init gicv5_its_init(struct device_node *node)
return -ENODEV;
}

+ /* Save the region to release if ITS setup fails after mapping it. */
+ ret = of_address_to_resource(node, idx, &res);
+ if (ret)
+ return ret;
+
its_base = of_io_request_and_map(node, idx, of_node_full_name(node));
if (IS_ERR(its_base)) {
pr_err("%pOF: unable to map GICv5 ITS_CONFIG_FRAME\n", node);
@@ -1212,6 +1218,7 @@ static int __init gicv5_its_init(struct device_node *node)

out_unmap:
iounmap(its_base);
+ release_mem_region(res.start, resource_size(&res));
return ret;
}


--
2.34.1