[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <750030f4-f396-57e7-3afc-23a206ed78a8@oracle.com>
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