aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/frontends/ds3000.c
diff options
context:
space:
mode:
authorNicolas Noirbent <nicolas.noirbent@smartjog.com>2010-03-22 13:54:43 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-05-19 11:57:15 -0400
commit450df22286eee7431b34644410aeff18936c7afe (patch)
tree6e9e8925811ee4e895f94aba45e9b3a7914b1a20 /drivers/media/dvb/frontends/ds3000.c
parentb4bc3dcbefc0a359744ab13bc8b67c6cb5cd0086 (diff)
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: Nicolas Noirbent <nicolas.noirbent@smartjog.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/frontends/ds3000.c')
-rw-r--r--drivers/media/dvb/frontends/ds3000.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/dvb/frontends/ds3000.c b/drivers/media/dvb/frontends/ds3000.c
index cff3535566fe..78001e8bcdb7 100644
--- a/drivers/media/dvb/frontends/ds3000.c
+++ b/drivers/media/dvb/frontends/ds3000.c
@@ -719,7 +719,7 @@ static int ds3000_read_snr(struct dvb_frontend *fe, u16 *snr)
719 (ds3000_readreg(state, 0x8d) << 4); 719 (ds3000_readreg(state, 0x8d) << 4);
720 dvbs2_signal_reading = ds3000_readreg(state, 0x8e); 720 dvbs2_signal_reading = ds3000_readreg(state, 0x8e);
721 tmp = dvbs2_signal_reading * dvbs2_signal_reading >> 1; 721 tmp = dvbs2_signal_reading * dvbs2_signal_reading >> 1;
722 if (dvbs2_signal_reading == 0) { 722 if (tmp == 0) {
723 *snr = 0x0000; 723 *snr = 0x0000;
724 return 0; 724 return 0;
725 } 725 }