* [PATCH] mfd: mt6358-irq: Fix missing irq_domain_remove() in error path
@ 2025-11-18 12:14 Haotian Zhang
2025-11-20 14:24 ` (subset) " Lee Jones
0 siblings, 1 reply; 2+ messages in thread
From: Haotian Zhang @ 2025-11-18 12:14 UTC (permalink / raw)
To: lee, matthias.bgg, angelogioacchino.delregno
Cc: linux-kernel, linux-arm-kernel, linux-mediatek, Haotian Zhang
If devm_request_threaded_irq() fails after irq_domain_add_linear()
succeeds in mt6358_irq_init(), the function returns without removing
the created IRQ domain, leading to a resource leak.
Call irq_domain_remove() in the error path after a successful
irq_domain_add_linear() to properly release the IRQ domain.
Fixes: 2b91c28f2abd ("mfd: Add support for the MediaTek MT6358 PMIC")
Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn>
---
drivers/mfd/mt6358-irq.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/mfd/mt6358-irq.c b/drivers/mfd/mt6358-irq.c
index f467b00d2366..74cf20843044 100644
--- a/drivers/mfd/mt6358-irq.c
+++ b/drivers/mfd/mt6358-irq.c
@@ -285,6 +285,7 @@ int mt6358_irq_init(struct mt6397_chip *chip)
if (ret) {
dev_err(chip->dev, "Failed to register IRQ=%d, ret=%d\n",
chip->irq, ret);
+ irq_domain_remove(chip->irq_domain);
return ret;
}
--
2.50.1.windows.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: (subset) [PATCH] mfd: mt6358-irq: Fix missing irq_domain_remove() in error path
2025-11-18 12:14 [PATCH] mfd: mt6358-irq: Fix missing irq_domain_remove() in error path Haotian Zhang
@ 2025-11-20 14:24 ` Lee Jones
0 siblings, 0 replies; 2+ messages in thread
From: Lee Jones @ 2025-11-20 14:24 UTC (permalink / raw)
To: lee, matthias.bgg, angelogioacchino.delregno, Haotian Zhang
Cc: linux-kernel, linux-arm-kernel, linux-mediatek
On Tue, 18 Nov 2025 20:14:27 +0800, Haotian Zhang wrote:
> If devm_request_threaded_irq() fails after irq_domain_add_linear()
> succeeds in mt6358_irq_init(), the function returns without removing
> the created IRQ domain, leading to a resource leak.
>
> Call irq_domain_remove() in the error path after a successful
> irq_domain_add_linear() to properly release the IRQ domain.
>
> [...]
Applied, thanks!
[1/1] mfd: mt6358-irq: Fix missing irq_domain_remove() in error path
commit: 384bd58bf7095e4c4c8fcdbcede316ef342c630c
--
Lee Jones [李琼斯]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-11-20 14:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-18 12:14 [PATCH] mfd: mt6358-irq: Fix missing irq_domain_remove() in error path Haotian Zhang
2025-11-20 14:24 ` (subset) " Lee Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).