Skip to content

Commit

Permalink
V4L/DVB (4874): Fix oops on symbol rate==0
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andrew de Quincey authored and Mauro Carvalho Chehab committed Nov 26, 2006
1 parent f766816 commit 221a09d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/media/dvb/frontends/tda10086.c
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,10 @@ static int tda10086_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_pa

dprintk ("%s\n", __FUNCTION__);

// check for invalid symbol rate
if (fe_params->u.qpsk.symbol_rate < 500000)
return -EINVAL;

// calculate the updated frequency (note: we convert from Hz->kHz)
tmp64 = tda10086_read_byte(state, 0x52);
tmp64 |= (tda10086_read_byte(state, 0x51) << 8);
Expand Down

0 comments on commit 221a09d

Please sign in to comment.