aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAndrew de Quincey <adq_dvb@lidskialf.net>2006-11-22 16:01:21 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-11-26 08:02:43 -0500
commit221a09d5c4cb8384d9be74db60f37a5752675255 (patch)
tree66da0b068aa62537b53252a2f1316c5183f895f2 /drivers
parentf7668162a366d1ce0fe84122d11108e13a8ce950 (diff)
V4L/DVB (4874): Fix oops on symbol rate==0
The tda10086 causes an oops (divide by zero) if a zero symbol rate is used; this prevents this. Signed-off-by: Andrew de Quincey <adq_dvb@lidskialf.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/dvb/frontends/tda10086.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/media/dvb/frontends/tda10086.c b/drivers/media/dvb/frontends/tda10086.c
index 7456b0b9976b..4c27a2d90a38 100644
--- a/drivers/media/dvb/frontends/tda10086.c
+++ b/drivers/media/dvb/frontends/tda10086.c
@@ -441,6 +441,10 @@ static int tda10086_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_pa
441 441
442 dprintk ("%s\n", __FUNCTION__); 442 dprintk ("%s\n", __FUNCTION__);
443 443
444 // check for invalid symbol rate
445 if (fe_params->u.qpsk.symbol_rate < 500000)
446 return -EINVAL;
447
444 // calculate the updated frequency (note: we convert from Hz->kHz) 448 // calculate the updated frequency (note: we convert from Hz->kHz)
445 tmp64 = tda10086_read_byte(state, 0x52); 449 tmp64 = tda10086_read_byte(state, 0x52);
446 tmp64 |= (tda10086_read_byte(state, 0x51) << 8); 450 tmp64 |= (tda10086_read_byte(state, 0x51) << 8);