]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[media] mb86a20s: always initialize a return value
authorNicolas Iooss <nicolas.iooss_linux@m4x.org>
Sat, 10 Sep 2016 16:49:01 +0000 (13:49 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Mon, 24 Oct 2016 19:16:56 +0000 (17:16 -0200)
In mb86a20s_read_status_and_stats(), when mb86a20s_read_status() fails,
the function returns the value in variable rc without initializing it
first. Fix this by propagating the error code from variable status_nr.

This bug has been found using clang and -Wsometimes-uninitialized
warning flag.

Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/dvb-frontends/mb86a20s.c

index fe79358b035e5e7d608c1fd2255db4060772a654..27f425137ce6d10aea190528b94c1023a2bee57b 100644 (file)
@@ -1967,6 +1967,7 @@ static int mb86a20s_read_status_and_stats(struct dvb_frontend *fe,
        if (status_nr < 0) {
                dev_err(&state->i2c->dev,
                        "%s: Can't read frontend lock status\n", __func__);
+               rc = status_nr;
                goto error;
        }