]> err.no Git - linux-2.6/commitdiff
V4L/DVB: DiB3000MC: set FE to NULL after being freed
authorPatrick Boettcher <pb@linuxtv.org>
Tue, 8 Aug 2006 18:48:11 +0000 (15:48 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Tue, 26 Sep 2006 14:53:48 +0000 (11:53 -0300)
DiB3000MC: set FE to NULL after being freed

Signed-off-by: Patrick Boettcher <pb@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/dvb/dvb-usb/dvb-usb-dvb.c
drivers/media/dvb/frontends/dib3000mc.c

index 3a19689d9c9a4f8c95acd20b9c9a98cd6d01573e..fe6208ada9037c916ffdb62c594bbe1a9f3b7dd6 100644 (file)
@@ -175,7 +175,7 @@ static int dvb_usb_fe_sleep(struct dvb_frontend *fe)
 int dvb_usb_fe_init(struct dvb_usb_device* d)
 {
        if (d->props.frontend_attach == NULL) {
-               err("strange '%s' doesn't want to attach a frontend.",d->desc->name);
+               err("strange: '%s' doesn't want to attach a frontend.",d->desc->name);
                return 0;
        }
 
@@ -186,8 +186,7 @@ int dvb_usb_fe_init(struct dvb_usb_device* d)
 
                if (dvb_register_frontend(&d->dvb_adap, d->fe)) {
                        err("Frontend registration failed.");
-                       if (d->fe->ops.release)
-                               d->fe->ops.release(d->fe);
+                       dvb_frontend_detach(d->fe);
                        d->fe = NULL;
                        return -ENODEV;
                }
@@ -203,7 +202,9 @@ int dvb_usb_fe_init(struct dvb_usb_device* d)
 
 int dvb_usb_fe_exit(struct dvb_usb_device *d)
 {
-       if (d->fe != NULL)
+       if (d->fe != NULL) {
                dvb_unregister_frontend(d->fe);
+               dvb_frontend_detach(d->fe);
+       }
        return 0;
 }
index cc41c6bcdaf6e5089d0bf14f7c18a6a01b2c0a68..04ce6276f8731960eaefb3e90785bfd1631588f0 100644 (file)
@@ -899,9 +899,10 @@ int dib3000mc_attach(struct i2c_adapter *i2c_adap, int no_of_demods, u8    default_
        return 0;
 
 error:
-       for (k = 0; k < num; k++)
+       for (k = 0; k < num; k++) {
                kfree(demod[k]->demodulator_priv);
-
+               demod[k] = NULL;
+       }
        return -EINVAL;
 }