Sfoglia il codice sorgente

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>
Andrew de Quincey 18 anni fa
parent
commit
221a09d5c4
1 ha cambiato i file con 4 aggiunte e 0 eliminazioni
  1. 4 0
      drivers/media/dvb/frontends/tda10086.c

+ 4 - 0
drivers/media/dvb/frontends/tda10086.c

@@ -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);