[PATCH 1/3] irqchip/ls-extirq: Remove the interrupt domain on unbind

From: Guangshuo Li

Date: Sat Nov 28 2026 - 04:41:27 EST


The IRQ domain remains registered when the platform device releases
the controller data used by its domain operations. Remove the
domain as part of device teardown.

This issue was found by our static analysis tool under development.

Fixes: 05cd654829dd ("irqchip/ls-extirq: Convert to a platform driver to make it work again")
Signed-off-by: Guangshuo Li <liguangshuo@xxxxxxxxxxxxxxx>
---
drivers/irqchip/irq-ls-extirq.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/irqchip/irq-ls-extirq.c b/drivers/irqchip/irq-ls-extirq.c
index b791cb03a44a..ae8e9c918ac8 100644
--- a/drivers/irqchip/irq-ls-extirq.c
+++ b/drivers/irqchip/irq-ls-extirq.c
@@ -168,6 +168,11 @@ ls_extirq_parse_map(struct ls_extirq_data *priv, struct device_node *node)
return 0;
}

+static void ls_extirq_remove_domain(void *data)
+{
+ irq_domain_remove(data);
+}
+
static int ls_extirq_probe(struct platform_device *pdev)
{
struct irq_domain *domain, *parent_domain;
@@ -209,7 +214,7 @@ static int ls_extirq_probe(struct platform_device *pdev)
if (!domain)
return dev_err_probe(dev, -ENOMEM, "Failed to add IRQ domain\n");

- return 0;
+ return devm_add_action_or_reset(dev, ls_extirq_remove_domain, domain);
}

static const struct of_device_id ls_extirq_dt_ids[] = {

--
2.43.0