From: Haofeng Li <920484857@qq.com>
To: tglx@kernel.org
Cc: linux-kernel@vger.kernel.org, Haofeng Li <13266079573@163.com>,
Haofeng Li <lihaofeng@kylinos.cn>,
Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
Samuel Holland <samuel@sholland.org>,
Marc Zyngier <maz@kernel.org>,
linux-mips@vger.kernel.org
Subject: [PATCH 08/16] irqchip/mips-gic: clean up if IPI domain registration fails
Date: Tue, 14 Jul 2026 21:24:44 +0800 [thread overview]
Message-ID: <tencent_63B40FEEA9049AB3A522A50D2CF58ECA560A@qq.com> (raw)
In-Reply-To: <20260714132453.3302672-1-920484857@qq.com>
From: Haofeng Li <lihaofeng@kylinos.cn>
If gic_register_ipi_domain() fails, the primary IRQ domain and the
mapped register base are left allocated.
At this point the CPU interrupt handler has not yet been published.
Remove the primary domain, unmap the register base, and clear both
global pointers before returning the error.
Fixes: 8190cc572981 ("irqchip/mips-gic: Only register IPI domain when SMP is enabled")
Signed-off-by: Haofeng Li <lihaofeng@kylinos.cn>
---
drivers/irqchip/irq-mips-gic.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/irqchip/irq-mips-gic.c b/drivers/irqchip/irq-mips-gic.c
index 85fe0d8a34c5..2f2ba54f227f 100644
--- a/drivers/irqchip/irq-mips-gic.c
+++ b/drivers/irqchip/irq-mips-gic.c
@@ -968,8 +968,13 @@ static int __init gic_of_init(struct device_node *node,
}
ret = gic_register_ipi_domain(node);
- if (ret)
+ if (ret) {
+ irq_domain_remove(gic_irq_domain);
+ gic_irq_domain = NULL;
+ iounmap(mips_gic_base);
+ mips_gic_base = NULL;
return ret;
+ }
if (cpu_has_veic) {
/* Always use vector 1 in EIC mode */
--
2.25.1
next prev parent reply other threads:[~2026-07-14 13:27 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260714122351.3274006-1-lihaofeng@kylinos.cn>
[not found] ` <20260714132453.3302672-1-920484857@qq.com>
2026-07-14 13:24 ` [PATCH 05/16] irqchip/bcm7038-l1: clean up init failure paths Haofeng Li
2026-07-28 17:36 ` Florian Fainelli
2026-07-14 13:24 ` [PATCH 06/16] irqchip/loongson-liointc: unmap per-core iomaps on error Haofeng Li
2026-08-02 16:31 ` Radu Rendec
2026-07-14 13:24 ` [PATCH 07/16] irqchip/mips-gic: clean up IRQ domain creation failure Haofeng Li
2026-08-02 19:19 ` Radu Rendec
2026-07-14 13:24 ` Haofeng Li [this message]
2026-08-02 19:26 ` [PATCH 08/16] irqchip/mips-gic: clean up if IPI domain registration fails Radu Rendec
2026-07-14 13:24 ` [PATCH 09/16] irqchip/econet: clean up VEIC initialization Haofeng Li
2026-07-23 1:09 ` Caleb James DeLisle
2026-07-14 13:24 ` [PATCH 11/16] irqchip/loongson-eiointc: preserve live state on cascade failure Haofeng Li
2026-07-14 13:24 ` [PATCH 16/16] irqchip/bcm7120-l2: fix parent IRQ count error handling Haofeng Li
2026-07-28 15:57 ` Florian Fainelli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tencent_63B40FEEA9049AB3A522A50D2CF58ECA560A@qq.com \
--to=920484857@qq.com \
--cc=13266079573@163.com \
--cc=lihaofeng@kylinos.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=maz@kernel.org \
--cc=samuel@sholland.org \
--cc=tglx@kernel.org \
--cc=tsbogend@alpha.franken.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox