[linux-dvb] PCTV200e driver: solved "NULL pointer dereference"
Michel Verbraak
michel at verbraak.org
Sat Jul 14 08:23:33 CEST 2007
Juan Antonio Garcia schreef:
>
> After a bit of work I have found the reason for getting the "NULL
> Pointer dereference" error when the PCTV200e is initialized.
>
> The reason 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, in "mt2060.c" the following
> line:
>
> struct dvb_frontend *fe = ops->fe;
>
> Tries to reference the NULL pointer.
>
> I have made the following modification to "pctv200e.c":
>
> static int pctv200e_frontend_attach(struct dvb_usb_adapter *adap)
> {
> struct dvb_frontend *fe;
>
> if ((adap->fe = dvb_attach(mt352_attach, &pctv200e_mt352_config,
> &adap->dev->i2c_adap)) != NULL) {
> adap->fe->ops.tuner_ops.calc_regs = dvb_usb_tuner_calc_regs;
> return 0;
> } else {
> warn("frontend_attach failed (mt352)");
>
> fe = kzalloc(sizeof(struct dvb_frontend), GFP_KERNEL);
> if (fe == NULL)
> return -EIO;
>
> adap->fe = fe;
> }
> warn("next: attaching tuner.");
>
> After this the PCTV200e registers and unregisters successfully.
> So I guess these changes help...
>
> I would like to continue helping. But I would need some directions,
> because I don't know what to do next...
>
> And I am really interested in having the PCTV200e under Linux.
>
> Thanks,
>
> Juan
>
> ------------------------------------------------------------------------
>
> LLama Gratis a cualquier PC del Mundo.
> Llamadas a fijos y móviles desde 1 céntimo por minuto.
> http://es.voice.yahoo.com
> <http://us.rd.yahoo.com/mail/es/tagline/messenger/*http://es.voice.yahoo.com/>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> linux-dvb mailing list
> linux-dvb at linuxtv.org
> http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
Juan,
Have a look at the following page fo your patch and how to get it into
mainline. Create a patch file and send it to this list and it should get
incorporated ito mainline as it looks to me as a sound solution to a bug.
http://www.linuxtv.org/v4lwiki/index.php/SubmittingPatches
Regards,
Michel.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.linuxtv.org/pipermail/linux-dvb/attachments/20070714/a68f77d0/attachment.htm
More information about the linux-dvb
mailing list