Skip to contentSkip to conversation

media: imx274: Silence uninitialized variable warning

PATCH New Dan Carpenter 1 participant 1 message Dec 5, 2017

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: imx274: Silence uninitialized variable warning

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.

drivers/media/i2c/imx274.c +1 -1
index 800b9bf9cdd3..e7c12933cfd2 100644
@@ -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;