aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/media/dvb-frontends
diff options
context:
space:
mode:
authorKangjie Lu <kjlu@umn.edu>2018-12-20 02:48:42 -0500
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2019-01-16 11:43:48 -0500
commitc9b7d8f252a5a6f8ca6e948151367cbc7bc4b776 (patch)
tree1e833b698a630062e814a65d89889387a6e85539 /drivers/media/dvb-frontends
parentmedia: seco-cec: fix RC_CORE dependency (diff)
downloadwireguard-linux-c9b7d8f252a5a6f8ca6e948151367cbc7bc4b776.tar.xz
wireguard-linux-c9b7d8f252a5a6f8ca6e948151367cbc7bc4b776.zip
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: Kangjie Lu <kjlu@umn.edu> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/dvb-frontends')
-rw-r--r--drivers/media/dvb-frontends/lgdt3306a.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/media/dvb-frontends/lgdt3306a.c b/drivers/media/dvb-frontends/lgdt3306a.c
index cee9c83e48de..99c6289ae585 100644
--- a/drivers/media/dvb-frontends/lgdt3306a.c
+++ b/drivers/media/dvb-frontends/lgdt3306a.c
@@ -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