aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/tuners
diff options
context:
space:
mode:
authorLuo Meng <luomeng12@huawei.com>2020-11-25 02:34:37 +0100
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2021-01-27 12:59:17 +0100
commitfcf8d018bdca0453b8d6359062e6bc1512d04c38 (patch)
tree0fafbf29d3edf280e3c309b49b8ae95c344673ca /drivers/media/tuners
parentmedia: saa7134: Fix fall-through warnings for Clang (diff)
downloadlinux-dev-fcf8d018bdca0453b8d6359062e6bc1512d04c38.tar.xz
linux-dev-fcf8d018bdca0453b8d6359062e6bc1512d04c38.zip
media: qm1d1c0042: fix error return code in qm1d1c0042_init()
Fix to return a negative error code from the error handling case instead of 0 in function qm1d1c0042_init(), as done elsewhere in this function. Fixes: ab4d14528fdf ("[media] em28xx: add support for PLEX PX-BCUD (ISDB-S)") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Luo Meng <luomeng12@huawei.com> Acked-by: Akihiro Tsukada <tskd08@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media/tuners')
-rw-r--r--drivers/media/tuners/qm1d1c0042.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/media/tuners/qm1d1c0042.c b/drivers/media/tuners/qm1d1c0042.c
index 0e26d22f0b26..53aa2558f71e 100644
--- a/drivers/media/tuners/qm1d1c0042.c
+++ b/drivers/media/tuners/qm1d1c0042.c
@@ -343,8 +343,10 @@ static int qm1d1c0042_init(struct dvb_frontend *fe)
if (val == reg_initval[reg_index][0x00])
break;
}
- if (reg_index >= QM1D1C0042_NUM_REG_ROWS)
+ if (reg_index >= QM1D1C0042_NUM_REG_ROWS) {
+ ret = -EINVAL;
goto failed;
+ }
memcpy(state->regs, reg_initval[reg_index], QM1D1C0042_NUM_REGS);
usleep_range(2000, 3000);