Commit 4e66c97c authored by Patrick Boettcher's avatar Patrick Boettcher Committed by Mauro Carvalho Chehab

V4L/DVB: DiB3000MC: set FE to NULL after being freed

DiB3000MC: set FE to NULL after being freed
Signed-off-by: default avatarPatrick Boettcher <pb@linuxtv.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent a2c00a0e
...@@ -175,7 +175,7 @@ static int dvb_usb_fe_sleep(struct dvb_frontend *fe) ...@@ -175,7 +175,7 @@ static int dvb_usb_fe_sleep(struct dvb_frontend *fe)
int dvb_usb_fe_init(struct dvb_usb_device* d) int dvb_usb_fe_init(struct dvb_usb_device* d)
{ {
if (d->props.frontend_attach == NULL) { 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; return 0;
} }
...@@ -186,8 +186,7 @@ int dvb_usb_fe_init(struct dvb_usb_device* d) ...@@ -186,8 +186,7 @@ int dvb_usb_fe_init(struct dvb_usb_device* d)
if (dvb_register_frontend(&d->dvb_adap, d->fe)) { if (dvb_register_frontend(&d->dvb_adap, d->fe)) {
err("Frontend registration failed."); err("Frontend registration failed.");
if (d->fe->ops.release) dvb_frontend_detach(d->fe);
d->fe->ops.release(d->fe);
d->fe = NULL; d->fe = NULL;
return -ENODEV; return -ENODEV;
} }
...@@ -203,7 +202,9 @@ int dvb_usb_fe_init(struct dvb_usb_device* d) ...@@ -203,7 +202,9 @@ int dvb_usb_fe_init(struct dvb_usb_device* d)
int dvb_usb_fe_exit(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_unregister_frontend(d->fe);
dvb_frontend_detach(d->fe);
}
return 0; return 0;
} }
...@@ -899,9 +899,10 @@ int dib3000mc_attach(struct i2c_adapter *i2c_adap, int no_of_demods, u8 default_ ...@@ -899,9 +899,10 @@ int dib3000mc_attach(struct i2c_adapter *i2c_adap, int no_of_demods, u8 default_
return 0; return 0;
error: error:
for (k = 0; k < num; k++) for (k = 0; k < num; k++) {
kfree(demod[k]->demodulator_priv); kfree(demod[k]->demodulator_priv);
demod[k] = NULL;
}
return -EINVAL; return -EINVAL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment