lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <73bc2c81-2d8d-4d17-8adf-99770846b979@oracle.com>
Date: Sat, 11 Oct 2025 22:57:44 +0530
From: Harshit Mogalapalli <harshit.m.mogalapalli@...cle.com>
To: Cryolitia PukNgae <cryolitia@...ontech.com>,
        Guenter Roeck <linux@...ck-us.net>, linux-hwmon@...r.kernel.org,
        linux-kernel@...r.kernel.org
Cc: dan.carpenter@...aro.org, kernel-janitors@...r.kernel.org,
        error27@...il.com
Subject: Re: [PATCH] hwmon: gpd-fan: Fix return value when
 platform_get_resource() fails

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@...cle.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
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ