| From 67e9a53647cd23223704f7d27360b7a493534854 Mon Sep 17 00:00:00 2001 |
| From: Sasha Levin <sashal@kernel.org> |
| Date: Tue, 18 Nov 2025 20:15:00 +0800 |
| Subject: mfd: mt6397-irq: Fix missing irq_domain_remove() in error path |
| |
| From: Haotian Zhang <vulab@iscas.ac.cn> |
| |
| [ 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> |
| --- |
| drivers/mfd/mt6397-irq.c | 1 + |
| 1 file changed, 1 insertion(+) |
| |
| diff --git a/drivers/mfd/mt6397-irq.c b/drivers/mfd/mt6397-irq.c |
| index eff53fed8fe73..eee40ec162ceb 100644 |
| --- a/drivers/mfd/mt6397-irq.c |
| +++ b/drivers/mfd/mt6397-irq.c |
| @@ -213,6 +213,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; |
| } |
| |
| -- |
| 2.51.0 |
| |