]> Gentwo Git Trees - linux/.git/commitdiff
mfd: mt6397-irq: Fix missing irq_domain_remove() in error path
authorHaotian Zhang <vulab@iscas.ac.cn>
Tue, 18 Nov 2025 12:15:00 +0000 (20:15 +0800)
committerLee Jones <lee@kernel.org>
Thu, 20 Nov 2025 14:22:36 +0000 (14:22 +0000)
If devm_request_threaded_irq() fails after irq_domain_create_linear()
succeeds in mt6397_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_create_linear() to properly release the IRQ domain.

Fixes: a4872e80ce7d ("mfd: mt6397: Extract IRQ related code from core driver")
Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn>
Link: https://patch.msgid.link/20251118121500.605-1-vulab@iscas.ac.cn
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/mfd/mt6397-irq.c

index 0e463026c5a918b2dc5a43c13d9badcc576f908d..5d2e5459f744494040f39e6dd5cd4976a80b3362 100644 (file)
@@ -229,6 +229,7 @@ int mt6397_irq_init(struct mt6397_chip *chip)
        if (ret) {
                dev_err(chip->dev, "failed to register irq=%d; err: %d\n",
                        chip->irq, ret);
+               irq_domain_remove(chip->irq_domain);
                return ret;
        }