mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH next] media: i2c: imx214: Fix uninitialized variable in imx214_set_ctrl()
@ 2025-02-18 13:05 Dan Carpenter
  2025-02-19 19:13 ` André Apitzsch
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2025-02-18 13:05 UTC (permalink / raw)
  To: André Apitzsch
  Cc: Ricardo Ribalda, Sakari Ailus, Mauro Carvalho Chehab,
	Hans Verkuil, linux-media, linux-kernel, kernel-janitors

You can't pass uninitialized "ret" variables to cci_write().  It has to
start as zero.

Fixes: 4f0aeba4f155 ("media: i2c: imx214: Convert to CCI register access helpers")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 drivers/media/i2c/imx214.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/i2c/imx214.c b/drivers/media/i2c/imx214.c
index 6c3f6f3c8b1f..68775ee8256e 100644
--- a/drivers/media/i2c/imx214.c
+++ b/drivers/media/i2c/imx214.c
@@ -795,7 +795,7 @@ static int imx214_set_ctrl(struct v4l2_ctrl *ctrl)
 					     struct imx214, ctrls);
 	const struct v4l2_mbus_framefmt *format = NULL;
 	struct v4l2_subdev_state *state;
-	int ret;
+	int ret = 0;
 
 	if (ctrl->id == V4L2_CID_VBLANK) {
 		int exposure_max, exposure_def;
-- 
2.47.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH next] media: i2c: imx214: Fix uninitialized variable in imx214_set_ctrl()
  2025-02-18 13:05 [PATCH next] media: i2c: imx214: Fix uninitialized variable in imx214_set_ctrl() Dan Carpenter
@ 2025-02-19 19:13 ` André Apitzsch
  0 siblings, 0 replies; 2+ messages in thread
From: André Apitzsch @ 2025-02-19 19:13 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Ricardo Ribalda, Sakari Ailus, Mauro Carvalho Chehab,
	Hans Verkuil, linux-media, linux-kernel, kernel-janitors

Am Dienstag, dem 18.02.2025 um 16:05 +0300 schrieb Dan Carpenter:
> You can't pass uninitialized "ret" variables to cci_write().  It has
> to start as zero.
> 
> Fixes: 4f0aeba4f155 ("media: i2c: imx214: Convert to CCI register
> access helpers")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
>  drivers/media/i2c/imx214.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/i2c/imx214.c b/drivers/media/i2c/imx214.c
> index 6c3f6f3c8b1f..68775ee8256e 100644
> --- a/drivers/media/i2c/imx214.c
> +++ b/drivers/media/i2c/imx214.c
> @@ -795,7 +795,7 @@ static int imx214_set_ctrl(struct v4l2_ctrl
> *ctrl)
>  					     struct imx214, ctrls);
>  	const struct v4l2_mbus_framefmt *format = NULL;
>  	struct v4l2_subdev_state *state;
> -	int ret;
> +	int ret = 0;
>  
>  	if (ctrl->id == V4L2_CID_VBLANK) {
>  		int exposure_max, exposure_def;

Thanks.

Reviewed-by: André Apitzsch <git@apitzsch.eu>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-02-19 19:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-18 13:05 [PATCH next] media: i2c: imx214: Fix uninitialized variable in imx214_set_ctrl() Dan Carpenter
2025-02-19 19:13 ` André Apitzsch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®