Skip to contentSkip to conversation

qm1d1c0042: fix error return code in qm1d1c0042_init()

PATCH In review Luo Meng 2 participants 2 messages Nov 25, 2020 – Dec 3, 2020

Subsystems (2)
lore
Share & tools
lore

Luo Meng

author
#0 lore raw

PATCH 1/1 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)")
---
 drivers/media/tuners/qm1d1c0042.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/media/tuners/qm1d1c0042.c +3 -1
index 0e26d22f0b26..53aa2558f71e 100644
@@ -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);
 
Signature · 1 line
2.25.4