Commit 450df222 authored by Nicolas Noirbent's avatar Nicolas Noirbent Committed by Mauro Carvalho Chehab

V4L/DVB: ds3000: fix divide-by-zero error in ds3000_read_snr()

Fix a divide-by-zero error in ds3000's ds3000_read_snr(), when getting
a very low signal reading (dvbs2_signal_reading >= 1). This prevents
some nasty EIPs when running szap-s2 with a very low signal strength.
Signed-off-by: default avatarNicolas Noirbent <nicolas.noirbent@smartjog.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent b4bc3dcb
...@@ -719,7 +719,7 @@ static int ds3000_read_snr(struct dvb_frontend *fe, u16 *snr) ...@@ -719,7 +719,7 @@ static int ds3000_read_snr(struct dvb_frontend *fe, u16 *snr)
(ds3000_readreg(state, 0x8d) << 4); (ds3000_readreg(state, 0x8d) << 4);
dvbs2_signal_reading = ds3000_readreg(state, 0x8e); dvbs2_signal_reading = ds3000_readreg(state, 0x8e);
tmp = dvbs2_signal_reading * dvbs2_signal_reading >> 1; tmp = dvbs2_signal_reading * dvbs2_signal_reading >> 1;
if (dvbs2_signal_reading == 0) { if (tmp == 0) {
*snr = 0x0000; *snr = 0x0000;
return 0; return 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