From 19157003abe4d9ca4706fca8ff8306946f7942c6 Mon Sep 17 00:00:00 2001 From: Nicolas Iooss Date: Sat, 10 Sep 2016 13:49:01 -0300 Subject: [PATCH] [media] mb86a20s: always initialize a return value 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 Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb-frontends/mb86a20s.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/media/dvb-frontends/mb86a20s.c b/drivers/media/dvb-frontends/mb86a20s.c index fe79358..27f4251 100644 --- a/drivers/media/dvb-frontends/mb86a20s.c +++ b/drivers/media/dvb-frontends/mb86a20s.c @@ -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; } -- 2.7.4