<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><br>I have tested the patch below (included at the end) and seems to kill the "NULL
Pointer dereference" bug when initializing the PCTV200e driver.<br>
<br>
The
reason I found for the bug is that in the function "pctv200e_frontend_attach" "adap->fe"
is NULL, and when the mt352 registration fails it continues being NULL.
When the mt2060 is attached using: "(adap->fe = dvb_attach(mt2060_attach, &adap->fe->ops.tuner_ops, &adap->dev->i2c_adap, &pctv200e_mt2060_config, if1)". The "&adap->fe->ops.tuner_ops" is non existent since "adap->fe" is null. And when in "mt2060.c" the following line: <br><br>
struct dvb_frontend *fe = ops->fe;<br>
<br>
tries to reference the NULL pointer.<br><br>With this patch the initialization and deinitialization works fine.<br><br>I have tested it in a 2.6.20.16 Ubuntu Kernel.<br><br>Any way in my PCTV200e tuner still non of the frontends is attached, I get: <br><br>dvb-usb: no frontend was attached by 'Pinnacle PCTV 200e DVB-T'<br><br>Does anyone gets it attached?<br><br>Regards,<br><br>Juan<br><br><br>Patch file:<br>
<br>--- pctv200e.c.orig 2007-07-14 09:43:49.000000000 +0300<br>+++ pctv200e.c 2007-07-14 10:33:26.000000000 +0300<br>@@ -159,20 +159,31 @@ static u16 if1 = 1220; // this is probab<br> // source (for the tuner attach: dibusb-common.c)<br> static int pctv200e_frontend_attach(struct dvb_usb_adapter *adap)<br> {<br>+ struct dvb_frontend *fe;<br>+<br> if ((adap->fe = dvb_attach(mt352_attach, &pctv200e_mt352_config, &adap->dev->i2c_adap)) != NULL) {<br> adap->fe->ops.tuner_ops.calc_regs = dvb_usb_tuner_calc_regs;<br> return 0;<br>- } else<br>+ } else {<br> warn("frontend_attach failed (mt352)");<br> <br>+ fe = kzalloc(sizeof(struct dvb_frontend),
GFP_KERNEL);<br>+ if (fe == NULL)<br>+ return -EIO;<br>+<br>+ adap->fe = fe; <br>+ }<br>+<br> warn("next: attaching tuner.");<br> <br> if ((adap->fe = dvb_attach(mt2060_attach, &adap->fe->ops.tuner_ops, &adap->dev->i2c_adap, &pctv200e_mt2060_config, if1)) != NULL) {<br> adap->fe->ops.tuner_ops.fe = adap->fe;<br> adap->fe->ops.tuner_ops.set_params = pctv200e_mt2060_tuner_set_params;<br> return 0;<br>- }else<br>+ } else {<br>+ kfree(fe);<br> warn("frontend_attach failed
(mt2060)");<br>+ }<br> <br> warn(" frontend attached.");<br> return -EIO;<br><br></div><br>
                <hr size=1><br><font face="Verdana" size="-2">LLama Gratis a cualquier PC del Mundo.<br>Llamadas a fijos y móviles desde 1 céntimo por minuto.<br><a href="http://us.rd.yahoo.com/mail/es/tagline/messenger/*http://es.voice.yahoo.com/">http://es.voice.yahoo.com</a></font></body></html>