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

Felix Gu posted 1 patch 1 month, 1 week ago
There is a newer version of this series
drivers/mfd/tc3589x.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] mfd:tc3589:fix a potential resource leak
Posted by Felix Gu 1 month, 1 week 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>
---
 drivers/mfd/tc3589x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mfd/tc3589x.c b/drivers/mfd/tc3589x.c
index 2d4eb771e230..e3aaeb4701b8 100644
--- a/drivers/mfd/tc3589x.c
+++ b/drivers/mfd/tc3589x.c
@@ -410,7 +410,7 @@ static int tc3589x_probe(struct i2c_client *i2c)
 	if (ret)
 		return ret;
 
-	ret = request_threaded_irq(tc3589x->i2c->irq, NULL, tc3589x_irq,
+	ret = devm_request_threaded_irq(tc3589x->dev, tc3589x->i2c->irq, NULL, tc3589x_irq,
 				   IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
 				   "tc3589x", tc3589x);
 	if (ret) {

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

Best regards,
-- 
Felix Gu <gu_0233@qq.com>
Re: [PATCH] mfd:tc3589:fix a potential resource leak
Posted by Lee Jones 4 weeks ago
On Fri, 26 Dec 2025, Felix Gu wrote:

> 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>
> ---
>  drivers/mfd/tc3589x.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mfd/tc3589x.c b/drivers/mfd/tc3589x.c
> index 2d4eb771e230..e3aaeb4701b8 100644
> --- a/drivers/mfd/tc3589x.c
> +++ b/drivers/mfd/tc3589x.c
> @@ -410,7 +410,7 @@ static int tc3589x_probe(struct i2c_client *i2c)
>  	if (ret)
>  		return ret;
>  
> -	ret = request_threaded_irq(tc3589x->i2c->irq, NULL, tc3589x_irq,
> +	ret = devm_request_threaded_irq(tc3589x->dev, tc3589x->i2c->irq, NULL, tc3589x_irq,
>  				   IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
>  				   "tc3589x", tc3589x);

These two lines no longer line-up.  Please fix.

>  	if (ret) {
> 
> ---
> base-commit: 3d845d25026c5b1050e927e3ee4c515977a9b490
> change-id: 20251226-tc3589x-fix-50ce3358c7bf
> 
> Best regards,
> -- 
> Felix Gu <gu_0233@qq.com>
> 

-- 
Lee Jones [李琼斯]
Re: [PATCH] mfd:tc3589:fix a potential resource leak
Posted by Felix Gu 4 weeks ago
Hi Jones,

Thansk for review, I will fix it in V2.


Best regards,

Felix Gu

在 2026/1/9 23:41, Lee Jones 写道:
> On Fri, 26 Dec 2025, Felix Gu wrote:
>
>> 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>
>> ---
>>   drivers/mfd/tc3589x.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/mfd/tc3589x.c b/drivers/mfd/tc3589x.c
>> index 2d4eb771e230..e3aaeb4701b8 100644
>> --- a/drivers/mfd/tc3589x.c
>> +++ b/drivers/mfd/tc3589x.c
>> @@ -410,7 +410,7 @@ static int tc3589x_probe(struct i2c_client *i2c)
>>   	if (ret)
>>   		return ret;
>>   
>> -	ret = request_threaded_irq(tc3589x->i2c->irq, NULL, tc3589x_irq,
>> +	ret = devm_request_threaded_irq(tc3589x->dev, tc3589x->i2c->irq, NULL, tc3589x_irq,
>>   				   IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
>>   				   "tc3589x", tc3589x);
> These two lines no longer line-up.  Please fix.
>
>>   	if (ret) {
>>
>> ---
>> base-commit: 3d845d25026c5b1050e927e3ee4c515977a9b490
>> change-id: 20251226-tc3589x-fix-50ce3358c7bf
>>
>> Best regards,
>> -- 
>> Felix Gu <gu_0233@qq.com>
>>