[PATCH 1/3] media: dvb-frontends: cx24116: propagate firmware status read errors

From: Nikhil Gurudasani

Date: Sun Jul 19 2026 - 21:11:05 EST


cx24116_firmware_ondemand() tests the firmware status read inline. A
negative I2C error fails the condition and the function returns the
zero-initialized status, reporting success. A short transfer is returned
as a positive message count and is mistaken for a register value.

Normalize short register reads to -EREMOTEIO and propagate failures from
the firmware status read.

Fixes: 0d46748c3f87 ("V4L/DVB (8986): cx24116: Adding DVB-S2 demodulator support")
Signed-off-by: Nikhil Gurudasani <nikhilgurudasani314@xxxxxxxxx>
---
drivers/media/dvb-frontends/cx24116.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/media/dvb-frontends/cx24116.c b/drivers/media/dvb-frontends/cx24116.c
index c10053a7cb82..04b8f2fba4b0 100644
--- a/drivers/media/dvb-frontends/cx24116.c
+++ b/drivers/media/dvb-frontends/cx24116.c
@@ -258,7 +258,7 @@ static int cx24116_readreg(struct cx24116_state *state, u8 reg)
if (ret != 2) {
printk(KERN_ERR "%s: reg=0x%x (error=%d)\n",
__func__, reg, ret);
- return ret;
+ return ret < 0 ? ret : -EREMOTEIO;
}

if (debug > 1)
@@ -468,7 +468,11 @@ static int cx24116_firmware_ondemand(struct dvb_frontend *fe)

dprintk("%s()\n", __func__);

- if (cx24116_readreg(state, 0x20) > 0) {
+ ret = cx24116_readreg(state, 0x20);
+ if (ret < 0)
+ return ret;
+
+ if (ret > 0) {

if (state->skip_fw_load)
return 0;

base-commit: a52e6f7923c17a672135b485ffd96fbd72f46267
--
2.43.0