mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
To: Cryolitia PukNgae <cryolitia@uniontech.com>,
	Guenter Roeck <linux@roeck-us.net>,
	linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: dan.carpenter@linaro.org, kernel-janitors@vger.kernel.org,
	error27@gmail.com
Subject: Re: [PATCH] hwmon: gpd-fan: Fix return value when platform_get_resource() fails
Date: Sat, 11 Oct 2025 22:57:44 +0530	[thread overview]
Message-ID: <73bc2c81-2d8d-4d17-8adf-99770846b979@oracle.com> (raw)
In-Reply-To: <5FD7E8DCAC61F6BB+8248b939-e3b1-4966-9e6c-3189dd64029c@uniontech.com>

Hi,
On 11/10/25 11:42, Cryolitia PukNgae wrote:
> On 11/10/2025 04.43, Harshit Mogalapalli wrote:
>> When platform_get_resource() fails it returns NULL and not an error
>> pointer, accordingly change the error handling.
>>
>> Fixes: 0ab88e239439 ("hwmon: add GPD devices sensor driver")
>> Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
>> ---
>> This is based on static analysis with Smatch, only compile tested.
>> ---
>>   drivers/hwmon/gpd-fan.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/hwmon/gpd-fan.c b/drivers/hwmon/gpd-fan.c
>> index 644dc3ca9df7..eebe39ef9677 100644
>> --- a/drivers/hwmon/gpd-fan.c
>> +++ b/drivers/hwmon/gpd-fan.c
>> @@ -615,8 +615,8 @@ static int gpd_fan_probe(struct platform_device *pdev)
>>   	const struct device *hwdev;
>>   
>>   	res = platform_get_resource(pdev, IORESOURCE_IO, 0);
>> -	if (IS_ERR(res))
>> -		return dev_err_probe(dev, PTR_ERR(res),
>> +	if (!res)
>> +		return dev_err_probe(dev, -EINVAL,
>>   				     "Failed to get platform resource\n");
>>   
>>   	region = devm_request_region(dev, res->start,
> 
> Has it already been replaced by hwmon: gpd-fan: Fix error handling in gpd_fan_probe() ?
> 

No, this patch particularly fixes one more issue with return value of 
platform_get_resource()

Thanks,
Harshit

> thx
> 
> Link: https://lore.kernel.org/all/20251010204447.94343-1-harshit.m.mogalapalli@oracle.com/
> 
> Best regards,
> Cryolitia PukNgae
> 


  reply	other threads:[~2025-10-11 17:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-10 20:43 Harshit Mogalapalli
2025-10-11  6:12 ` Cryolitia PukNgae
2025-10-11 17:27   ` Harshit Mogalapalli [this message]
2025-10-12 17:50 ` Guenter Roeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=73bc2c81-2d8d-4d17-8adf-99770846b979@oracle.com \
    --to=harshit.m.mogalapalli@oracle.com \
    --cc=cryolitia@uniontech.com \
    --cc=dan.carpenter@linaro.org \
    --cc=error27@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®