linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] [media] m5mols: potential uninitialized variable
@ 2016-03-15  7:07 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2016-03-15  7:07 UTC (permalink / raw)
  To: Kyungmin Park
  Cc: Heungjun Kim, Mauro Carvalho Chehab, linux-media, linux-kernel,
	kernel-janitors

Smatch complains that there are some paths where "status" isn't
initialized.  The code does assume that m5mols_read_u8() can fail so it
seems as if Smatch is correct.

Let's initialize it to REG_ISO_AUTO which is zero.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/media/i2c/m5mols/m5mols_controls.c b/drivers/media/i2c/m5mols/m5mols_controls.c
index a60931e..c2218c0 100644
--- a/drivers/media/i2c/m5mols/m5mols_controls.c
+++ b/drivers/media/i2c/m5mols/m5mols_controls.c
@@ -405,7 +405,7 @@ static int m5mols_g_volatile_ctrl(struct v4l2_ctrl *ctrl)
 	struct v4l2_subdev *sd = to_sd(ctrl);
 	struct m5mols_info *info = to_m5mols(sd);
 	int ret = 0;
-	u8 status;
+	u8 status = REG_ISO_AUTO;
 
 	v4l2_dbg(1, m5mols_debug, sd, "%s: ctrl: %s (%d)\n",
 		 __func__, ctrl->name, info->isp_ready);

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-03-15  7:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-15  7:07 [patch] [media] m5mols: potential uninitialized variable Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).