This is an automatic generated email to let you know that the following patch 
were queued:

Subject: media: dvb: mb86a16: check the return value of mb86a16_read()
Author:  Yuanjun Gong <[email protected]>
Date:    Tue Jul 25 11:35:13 2023 +0800

return an error code if mb86a16_read() gets an unexpected return
value.

Signed-off-by: Yuanjun Gong <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
[hverkuil: add {} around the else statement]

 drivers/media/dvb-frontends/mb86a16.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

---

diff --git a/drivers/media/dvb-frontends/mb86a16.c 
b/drivers/media/dvb-frontends/mb86a16.c
index d3e29937cf4c..3ec2cb4fa504 100644
--- a/drivers/media/dvb-frontends/mb86a16.c
+++ b/drivers/media/dvb-frontends/mb86a16.c
@@ -1487,10 +1487,12 @@ static int mb86a16_set_fe(struct mb86a16_state *state)
                }
        }
 
-       mb86a16_read(state, 0x15, &agcval);
-       mb86a16_read(state, 0x26, &cnmval);
-       dprintk(verbose, MB86A16_INFO, 1, "AGC = %02x CNM = %02x", agcval, 
cnmval);
-
+       if (mb86a16_read(state, 0x15, &agcval) != 2 ||  mb86a16_read(state, 
0x26, &cnmval) != 2) {
+               dprintk(verbose, MB86A16_ERROR, 1, "I2C transfer error");
+               ret = -EREMOTEIO;
+       } else {
+               dprintk(verbose, MB86A16_INFO, 1, "AGC = %02x CNM = %02x", 
agcval, cnmval);
+       }
        return ret;
 }
 

_______________________________________________
linuxtv-commits mailing list
[email protected]
https://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to