[PATCH 13/16] irqchip/realtek-rtl: dispose parent mapping on domain failure
From: Haofeng Li
Date: Tue Jul 14 2026 - 09:36:53 EST
From: Haofeng Li <lihaofeng@xxxxxxxxxx>
If irq_domain_create_linear() fails after mapping the parent interrupt,
the parent IRQ mapping remains allocated.
Dispose the parent mapping before returning the error.
Fixes: 9070f1ce31c5 ("irqchip/realtek-rtl: use parent interrupts")
Signed-off-by: Haofeng Li <lihaofeng@xxxxxxxxxx>
---
drivers/irqchip/irq-realtek-rtl.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/irqchip/irq-realtek-rtl.c b/drivers/irqchip/irq-realtek-rtl.c
index 1f1dfa6e3d84..c20559591074 100644
--- a/drivers/irqchip/irq-realtek-rtl.c
+++ b/drivers/irqchip/irq-realtek-rtl.c
@@ -207,6 +207,7 @@ static int __init realtek_rtl_of_init(struct device_node *node, struct device_no
domain = irq_domain_create_linear(of_fwnode_handle(node), RTL_ICTL_NUM_INPUTS, &irq_domain_ops, NULL);
if (!domain) {
+ irq_dispose_mapping(parent_irq);
realtek_rtl_unmap_bases();
return -ENOMEM;
}
--
2.25.1