summaryrefslogtreecommitdiff
path: root/drivers/mfd
diff options
context:
space:
mode:
authorHaotian Zhang <vulab@iscas.ac.cn>2025-11-18 15:15:00 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-12-18 16:03:07 +0300
commitf620f2a12012a5bc9fa8c2688fdfd98fdae751ff (patch)
tree404e869383aac269972bf6971841d4070011fae0 /drivers/mfd
parentf75dc8cb4117067ed2bec2b27a61ccbc4ab65f33 (diff)
downloadlinux-f620f2a12012a5bc9fa8c2688fdfd98fdae751ff.tar.xz
mfd: mt6397-irq: Fix missing irq_domain_remove() in error path
[ Upstream commit b4b1bd1f330fdd13706382be6c90ce9f58cee3f5 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/mt6397-irq.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/mfd/mt6397-irq.c b/drivers/mfd/mt6397-irq.c
index 0e463026c5a9..5d2e5459f744 100644
--- a/drivers/mfd/mt6397-irq.c
+++ b/drivers/mfd/mt6397-irq.c
@@ -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;
}