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

Subject: media: stv0367: prevent division by zero
Author:  Mauro Carvalho Chehab <mche...@s-opensource.com>
Date:    Sun Jun 25 09:07:45 2017 -0300

While there's a test at the SNR calculus to avoid division by
zero, it will still follow the path that would do the division.
So, add a missing break there.

Signed-off-by: Mauro Carvalho Chehab <mche...@s-opensource.com>

 drivers/media/dvb-frontends/stv0367.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

---

diff --git a/drivers/media/dvb-frontends/stv0367.c 
b/drivers/media/dvb-frontends/stv0367.c
index fee2a1554203..e7bed20e80f6 100644
--- a/drivers/media/dvb-frontends/stv0367.c
+++ b/drivers/media/dvb-frontends/stv0367.c
@@ -3014,8 +3014,10 @@ static void stv0367ddb_read_snr(struct dvb_frontend *fe)
                regval = stv0367cab_snr_readreg(fe, 0);
 
                /* prevent division by zero */
-               if (!regval)
+               if (!regval) {
                        snrval = 0;
+                       break;
+               }
 
                tmpval = (cab_pwr * 320) / regval;
                snrval = ((tmpval != 0) ? (intlog2(tmpval) / 5581) : 0);

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
https://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to