[linux-dvb] PCTV200e driver: solved "NULL pointer dereference"

Juan Antonio Garcia juanantonio_garcia_01 at yahoo.es
Fri Jul 13 20:43:54 CEST 2007


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.linuxtv.org/pipermail/linux-dvb/attachments/20070713/4c903e5a/attachment.htm 


More information about the linux-dvb mailing list