浏览代码

[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 <nicolas.iooss_linux@m4x.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Nicolas Iooss 9 年之前
父节点
当前提交
19157003ab
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      drivers/media/dvb-frontends/mb86a20s.c

+ 1 - 0
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;
 	}