Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mfd: mt6358-irq: Fix missing irq_domain_remove() in error path

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>

authored by

Haotian Zhang and committed by
Lee Jones
384bd58b b4b1bd1f

+1
+1
drivers/mfd/mt6358-irq.c
··· 285 285 if (ret) { 286 286 dev_err(chip->dev, "Failed to register IRQ=%d, ret=%d\n", 287 287 chip->irq, ret); 288 + irq_domain_remove(chip->irq_domain); 288 289 return ret; 289 290 } 290 291