]> Gentwo Git Trees - linux/.git/commitdiff
mfd: mt6358-irq: Fix missing irq_domain_remove() in error path
authorHaotian Zhang <vulab@iscas.ac.cn>
Tue, 18 Nov 2025 12:14:27 +0000 (20:14 +0800)
committerLee Jones <lee@kernel.org>
Thu, 20 Nov 2025 14:24:03 +0000 (14:24 +0000)
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>
Link: https://patch.msgid.link/20251118121427.583-1-vulab@iscas.ac.cn
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/mfd/mt6358-irq.c

index f467b00d236600321ffdac156cb641f3cf2b43f7..74cf20843044092a1a957962c2ca33a00f2fd0e0 100644 (file)
@@ -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;
        }