Linux Media Controller development
 help / color / mirror / Atom feed
* [PATCH] media: imx274: Silence uninitialized variable warning
@ 2017-12-05 14:37 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2017-12-05 14:37 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Leon Luo
  Cc: Sakari Ailus, linux-media, kernel-janitors

Smatch complains that "err" can be uninitialized if we have a zero size
write.  The flow analysis is a little complicated so I'm not sure if
that's possible or not, but it's harmless to set this to zero and it
makes the code easier to read.

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

diff --git a/drivers/media/i2c/imx274.c b/drivers/media/i2c/imx274.c
index 800b9bf9cdd3..e7c12933cfd2 100644
--- a/drivers/media/i2c/imx274.c
+++ b/drivers/media/i2c/imx274.c
@@ -634,7 +634,7 @@ static int imx274_regmap_util_write_table_8(struct regmap *regmap,
 					    const struct reg_8 table[],
 					    u16 wait_ms_addr, u16 end_addr)
 {
-	int err;
+	int err = 0;
 	const struct reg_8 *next;
 	u8 val;
 

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

only message in thread, other threads:[~2017-12-05 14:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-05 14:37 [PATCH] media: imx274: Silence uninitialized variable warning Dan Carpenter

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