public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Dan Carpenter <dan.carpenter@linaro.org>,
	Alexandra Diupina <adiupina@astralinux.ru>
Cc: "Mauro Carvalho Chehab" <mchehab@kernel.org>,
	"Sakari Ailus" <sakari.ailus@linux.intel.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	linux-media@vger.kernel.org, linux-staging@lists.linux.dev,
	linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org
Subject: Re: [PATCH 1/4] Remove redundant return value check
Date: Thu, 2 Nov 2023 15:37:34 +0100	[thread overview]
Message-ID: <5ef34d97-e612-a92d-149a-8c966f363342@redhat.com> (raw)
In-Reply-To: <11e6e0bd-eab1-4aa7-8c5c-29de6cff1b3d@kadam.mountain>

Hi Dan,

On 11/2/23 15:35, Dan Carpenter wrote:
> On Thu, Nov 02, 2023 at 05:11:32PM +0300, Alexandra Diupina wrote:
>> media_entity_pads_init() will not return 0 only if the
>> 2nd parameter >= MEDIA_ENTITY_MAX_PADS (512), but 1 is
>> passed, so checking the return value is redundant
>>
>> Found by Linux Verification Center (linuxtesting.org) with SVACE.
>>
>> Fixes: ad85094b293e ("Revert "media: staging: atomisp: Remove driver"")
>> Signed-off-by: Alexandra Diupina <adiupina@astralinux.ru>
>> ---
>>  drivers/staging/media/atomisp/i2c/atomisp-gc2235.c        | 4 +---
>>  drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c       | 6 +-----
>>  drivers/staging/media/atomisp/i2c/atomisp-ov2722.c        | 2 --
>>  drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c | 2 --
>>  4 files changed, 2 insertions(+), 12 deletions(-)
>>
>> diff --git a/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c b/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c
>> index 9fa390fbc5f3..f10931a03285 100644
>> --- a/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c
>> +++ b/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c
>> @@ -840,9 +840,7 @@ static int gc2235_probe(struct i2c_client *client)
>>  	dev->ctrl_handler.lock = &dev->input_lock;
>>  	dev->sd.ctrl_handler = &dev->ctrl_handler;
>>  
>> -	ret = media_entity_pads_init(&dev->sd.entity, 1, &dev->pad);
>> -	if (ret)
>> -		gc2235_remove(client);
> 
> Not related to your patch but why doesn't this error path return an
> error?  Can that be right?

This is staging code and there are multiple camera sensor drivers under
drivers/staging/media/atomisp/i2c/

The gc2235 driver is one of the drivers which I have not yes tested
(I do have hw to test it, just no time), let alone worked on cleaning
it up...

Regards,

Hans



  reply	other threads:[~2023-11-02 14:37 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-02 14:11 [PATCH 1/4] Remove redundant return value check Alexandra Diupina
2023-11-02 14:11 ` [PATCH 2/4] " Alexandra Diupina
2023-11-02 14:55   ` Jacopo Mondi
2023-11-02 15:38   ` Laurent Pinchart
2023-11-02 14:11 ` [PATCH 4/4] " Alexandra Diupina
2023-11-02 14:21 ` [PATCH 1/4] " Hans de Goede
2023-11-02 15:09   ` Sakari Ailus
2023-11-02 14:31 ` Dan Carpenter
2023-11-02 14:35 ` Dan Carpenter
2023-11-02 14:37   ` Hans de Goede [this message]
2023-11-02 15:46 ` Uwe Kleine-König

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=5ef34d97-e612-a92d-149a-8c966f363342@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=adiupina@astralinux.ru \
    --cc=andy@kernel.org \
    --cc=dan.carpenter@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=lvc-project@linuxtesting.org \
    --cc=mchehab@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=u.kleine-koenig@pengutronix.de \
    /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