media: imx274: Silence uninitialized variable warning
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 5 Dec 2017 14:37:39 +0000 (09:37 -0500)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Fri, 5 Jan 2018 17:47:07 +0000 (12:47 -0500)
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>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/i2c/imx274.c

index 59d077b..664e8ac 100644 (file)
@@ -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;