[PATCH v2] mfd:tc3589:fix a potential resource leak

Felix Gu posted 1 patch 4 weeks ago
drivers/mfd/tc3589x.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
[PATCH v2] mfd:tc3589:fix a potential resource leak
Posted by Felix Gu 4 weeks ago
Use devm_request_threaded_irq to repalce request_threaded_irq to avoid
a potential resource leak.

Signed-off-by: Felix Gu <gu_0233@qq.com>
---
Changes in v2:
- Fix format.
- Link to v1: https://lore.kernel.org/lkml/tencent_EFCFAE871E8872447FF88F99091A51701D08@qq.com/
---
 drivers/mfd/tc3589x.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/mfd/tc3589x.c b/drivers/mfd/tc3589x.c
index 2d4eb771e230..f673ee4e1d16 100644
--- a/drivers/mfd/tc3589x.c
+++ b/drivers/mfd/tc3589x.c
@@ -410,9 +410,10 @@ static int tc3589x_probe(struct i2c_client *i2c)
 	if (ret)
 		return ret;
 
-	ret = request_threaded_irq(tc3589x->i2c->irq, NULL, tc3589x_irq,
-				   IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
-				   "tc3589x", tc3589x);
+	ret = devm_request_threaded_irq(tc3589x->dev, tc3589x->i2c->irq, NULL,
+					tc3589x_irq,
+					IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
+					"tc3589x", tc3589x);
 	if (ret) {
 		dev_err(tc3589x->dev, "failed to request IRQ: %d\n", ret);
 		return ret;

---
base-commit: 3d845d25026c5b1050e927e3ee4c515977a9b490
change-id: 20251226-tc3589x-fix-50ce3358c7bf

Best regards,
-- 
Felix Gu <gu_0233@qq.com>
Re: [PATCH v2] mfd:tc3589:fix a potential resource leak
Posted by Markus Elfring 4 weeks ago
> Use devm_request_threaded_irq to repalce request_threaded_irq to avoid

                                   replace?


Would it be helpful to append parentheses to function names?


> a potential resource leak.

How do you think about to add any tags (like “Fixes” and “Cc”) accordingly?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.19-rc4#n145

Regards,
Markus