[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <11e6e0bd-eab1-4aa7-8c5c-29de6cff1b3d@kadam.mountain>
Date: Thu, 2 Nov 2023 17:35:09 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Alexandra Diupina <adiupina@...ralinux.ru>
Cc: Hans de Goede <hdegoede@...hat.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Sakari Ailus <sakari.ailus@...ux.intel.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Andy Shevchenko <andy@...nel.org>,
Uwe Kleine-König
<u.kleine-koenig@...gutronix.de>, linux-media@...r.kernel.org,
linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org,
lvc-project@...uxtesting.org
Subject: Re: [PATCH 1/4] Remove redundant return value check
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@...ralinux.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?
> + media_entity_pads_init(&dev->sd.entity, 1, &dev->pad);
>
> return atomisp_register_i2c_module(&dev->sd, gcpdev, RAW_CAMERA);
regards,
dan carpenter
Powered by blists - more mailing lists