[PATCH] irqchip/xilinx: Fix potential stale domain on initialization failure
From: Guangshuo Li
Date: Tue Dec 01 2026 - 07:30:55 EST
If mapping the parent interrupt fails, initialization frees the
controller but leaves its IRQ domain registered with the freed
controller as host data.
Remove the unused domain before releasing the controller.
This issue was found by our static analysis tool under development.
Fixes: 9689c99e4950 ("irqchip/xilinx: Add support for parent intc")
Signed-off-by: Guangshuo Li <liguangshuo@xxxxxxxxxxxxxxx>
---
drivers/irqchip/irq-xilinx-intc.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/irqchip/irq-xilinx-intc.c b/drivers/irqchip/irq-xilinx-intc.c
index bba6f6dc405e..6f37383122c4 100644
--- a/drivers/irqchip/irq-xilinx-intc.c
+++ b/drivers/irqchip/irq-xilinx-intc.c
@@ -229,7 +229,7 @@ static int __init xilinx_intc_of_init(struct device_node *intc,
} else {
pr_err("irq-xilinx: interrupts property not in DT\n");
ret = -EINVAL;
- goto error;
+ goto remove_domain;
}
} else {
primary_intc = irqc;
@@ -239,6 +239,8 @@ static int __init xilinx_intc_of_init(struct device_node *intc,
return 0;
+remove_domain:
+ irq_domain_remove(irqc->root_domain);
error:
iounmap(irqc->base);
kfree(irqc);
base-commit: fe6ff8d5d675c01793b9f051d16055dd4aa75244