提交 221a09d5 编写于 作者: A Andrew de Quincey 提交者: Mauro Carvalho Chehab

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: NAndrew de Quincey <adq_dvb@lidskialf.net>
Signed-off-by: NMauro Carvalho Chehab <mchehab@infradead.org>
上级 f7668162
...@@ -441,6 +441,10 @@ static int tda10086_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_pa ...@@ -441,6 +441,10 @@ static int tda10086_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_pa
dprintk ("%s\n", __FUNCTION__); 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) // calculate the updated frequency (note: we convert from Hz->kHz)
tmp64 = tda10086_read_byte(state, 0x52); tmp64 = tda10086_read_byte(state, 0x52);
tmp64 |= (tda10086_read_byte(state, 0x51) << 8); tmp64 |= (tda10086_read_byte(state, 0x51) << 8);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册