[PATCH] irqchip/renesas-rzv2h: unwind on IRQ setup error

From: Cosmin Tanislav

Date: Wed May 20 2026 - 16:18:43 EST


The call to rzv2h_icu_setup_irqs() may fail after the syscore ops have
been registered and the IRQ domain has been created. In that case, only
the runtime PM usage count is unwound.

Unregister the syscore ops and remove the IRQ domain on this error path.

Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@xxxxxxxxxxx>
---
drivers/irqchip/irq-renesas-rzv2h.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/irqchip/irq-renesas-rzv2h.c b/drivers/irqchip/irq-renesas-rzv2h.c
index 31c543c876b1..b11fa48c1996 100644
--- a/drivers/irqchip/irq-renesas-rzv2h.c
+++ b/drivers/irqchip/irq-renesas-rzv2h.c
@@ -865,7 +865,7 @@ static int rzv2h_icu_probe_common(struct platform_device *pdev, struct device_no

ret = rzv2h_icu_setup_irqs(pdev, irq_domain);
if (ret)
- goto pm_put;
+ goto unregister_syscore;

/*
* coccicheck complains about a missing put_device call before returning, but it's a false
@@ -873,6 +873,9 @@ static int rzv2h_icu_probe_common(struct platform_device *pdev, struct device_no
*/
return 0;

+unregister_syscore:
+ unregister_syscore(&rzv2h_irqc_syscore);
+ irq_domain_remove(irq_domain);
pm_put:
pm_runtime_put_sync(dev);
return ret;
--
2.54.0