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]
Date:   Tue, 18 Jul 2023 19:40:19 +0530
From:   Harshit Mogalapalli <harshit.m.mogalapalli@...cle.com>
To:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc:     Tomi Valkeinen <tomi.valkeinen@...asonboard.com>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        Sakari Ailus <sakari.ailus@...ux.intel.com>,
        linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
        dan.carpenter@...aro.org, kernel-janitors@...r.kernel.org,
        error27@...il.com
Subject: Re: [PATCH next] media: i2c: fix error handling in
 ub960_rxport_add_serializer()

Hi Andy,

On 18/07/23 7:28 pm, Andy Shevchenko wrote:
> On Tue, Jul 18, 2023 at 01:58:46AM -0700, Harshit Mogalapalli wrote:
>> Smatch warns:
>>   drivers/media/i2c/ds90ub960.c:1671 ub960_rxport_add_serializer():
>>   err: 'rxport->ser.client' dereferencing possible ERR_PTR()
>>
>> i2c_new_client_device() returns error pointers on failure and in
>> dev_dbg statement we are dereferencing error pointer which is a bug.
>>
>> Fix this by using IS_ERR() which checks for error pointers.
> 
> ...
> 
>> -	if (!rxport->ser.client) {
>> +	if (IS_ERR(rxport->ser.client)) {
> 
>>   		dev_err(dev, "rx%u: cannot add %s i2c device", nport,
>>   			ser_info.type);
>>   		return -EIO;
> 
> It should be changed to return PTR_ERR(...);

I just sent a V2 with this suggestion included.

Thanks,
Harshit

> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ