提交 c9b7d8f2 编写于 作者: K Kangjie Lu 提交者: Mauro Carvalho Chehab

media: lgdt3306a: fix a missing check of return value

If lgdt3306a_read_reg() fails, the read data in "val" is incorrect, thus
shouldn't be further used. The fix inserts a check for the return value
of lgdt3306a_read_reg(). If it fails, goto fail.
Signed-off-by: NKangjie Lu <kjlu@umn.edu>
Signed-off-by: NSean Young <sean@mess.org>
Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
上级 f27dd0ad
......@@ -1685,7 +1685,10 @@ static int lgdt3306a_read_signal_strength(struct dvb_frontend *fe,
case QAM_256:
case QAM_AUTO:
/* need to know actual modulation to set proper SNR baseline */
lgdt3306a_read_reg(state, 0x00a6, &val);
ret = lgdt3306a_read_reg(state, 0x00a6, &val);
if (lg_chkerr(ret))
goto fail;
if(val & 0x04)
ref_snr = 2800; /* QAM-256 28dB */
else
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册