linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [media] qm1d1c0042: fix error return code in qm1d1c0042_init()
@ 2020-11-25  1:34 Luo Meng
  2020-12-03  2:05 ` Akihiro TSUKADA
  0 siblings, 1 reply; 2+ messages in thread
From: Luo Meng @ 2020-11-25  1:34 UTC (permalink / raw)
  To: tskd08, mchehab, luomeng12, sattnag, linux-media

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>
---
 drivers/media/tuners/qm1d1c0042.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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);
 
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] [media] qm1d1c0042: fix error return code in qm1d1c0042_init()
  2020-11-25  1:34 [PATCH] [media] qm1d1c0042: fix error return code in qm1d1c0042_init() Luo Meng
@ 2020-12-03  2:05 ` Akihiro TSUKADA
  0 siblings, 0 replies; 2+ messages in thread
From: Akihiro TSUKADA @ 2020-12-03  2:05 UTC (permalink / raw)
  To: Luo Meng, mchehab, sattnag, linux-media

Acked-by: Akihiro Tsukada <tskd08@gmail.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-12-03  2:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-25  1:34 [PATCH] [media] qm1d1c0042: fix error return code in qm1d1c0042_init() Luo Meng
2020-12-03  2:05 ` Akihiro TSUKADA

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).