Commit f5a1ba83 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

media: stv0367: prevent division by zero

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: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent d394ad12
...@@ -3014,8 +3014,10 @@ static void stv0367ddb_read_snr(struct dvb_frontend *fe) ...@@ -3014,8 +3014,10 @@ static void stv0367ddb_read_snr(struct dvb_frontend *fe)
regval = stv0367cab_snr_readreg(fe, 0); regval = stv0367cab_snr_readreg(fe, 0);
/* prevent division by zero */ /* prevent division by zero */
if (!regval) if (!regval) {
snrval = 0; snrval = 0;
break;
}
tmpval = (cab_pwr * 320) / regval; tmpval = (cab_pwr * 320) / regval;
snrval = ((tmpval != 0) ? (intlog2(tmpval) / 5581) : 0); snrval = ((tmpval != 0) ? (intlog2(tmpval) / 5581) : 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment