[tip: irq/urgent] irqchip/gic-v5: Fix gicv5_init_common() error paths

From: tip-bot2 for Lorenzo Pieralisi

Date: Thu Aug 20 2026 - 04:27:14 EST


The following commit has been merged into the irq/urgent branch of tip:

Commit-ID: 183750b276c229c5253b3b11581f6cd8877b753e
Gitweb: https://git.kernel.org/tip/183750b276c229c5253b3b11581f6cd8877b753e
Author: Lorenzo Pieralisi <lpieralisi@xxxxxxxxxx>
AuthorDate: Wed, 12 Aug 2026 11:10:32 +02:00
Committer: Thomas Gleixner <tglx@xxxxxxxxxx>
CommitterDate: Thu, 20 Aug 2026 10:23:53 +02:00

irqchip/gic-v5: Fix gicv5_init_common() error paths

Current code fails to disable interrupts on gicv5_starting_cpu() failure
and to set the handle_arch_irq pointer to NULL if gicv5_irs_enable() fails.

Update the respective error paths to fix them.

Fixes: 7ec80fb3f025 ("irqchip/gic-v5: Add GICv5 PPI support")
Signed-off-by: Lorenzo Pieralisi <lpieralisi@xxxxxxxxxx>
Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxx>
Link: https://patch.msgid.link/20260812-gicv5-7-2-fixes-v1-4-3743e82c69a4@xxxxxxxxxx
---
drivers/irqchip/irq-gic-v5.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/irqchip/irq-gic-v5.c b/drivers/irqchip/irq-gic-v5.c
index 2151464..24dbbf5 100644
--- a/drivers/irqchip/irq-gic-v5.c
+++ b/drivers/irqchip/irq-gic-v5.c
@@ -1174,7 +1174,7 @@ static int __init gicv5_init_common(struct fwnode_handle *parent_domain)

ret = gicv5_starting_cpu(smp_processor_id());
if (ret)
- goto out_dom;
+ goto out_int;

ret = set_handle_irq(gicv5_handle_irq);
if (ret)
@@ -1182,16 +1182,17 @@ static int __init gicv5_init_common(struct fwnode_handle *parent_domain)

ret = gicv5_irs_enable();
if (ret)
- goto out_int;
+ goto out_handle;

gicv5_smp_init();

gicv5_irs_its_probe();
return 0;

+out_handle:
+ set_handle_irq(NULL);
out_int:
gicv5_cpu_disable_interrupts();
-out_dom:
gicv5_free_domains();
return ret;
}