Skip to content

Commit

Permalink
V4L/DVB (4525): Drivers/media/dvb/dvb-usb/dibusb-mb.c: NULL dereference
Browse files Browse the repository at this point in the history
The Coverity checker spotted the following "we dereference d->fe only
when we know it's NULL" bug:
<--  snip  -->
...
static int dibusb_dib3000mb_frontend_attach(struct dvb_usb_device *d)
{
...
if ((d->fe = dib3000mb_attach(&demod_cfg,&d->i2c_adap,&st->ops)) == NULL) {
d->fe->ops.tuner_ops.init = dvb_usb_tuner_init_i2c;
d->fe->ops.tuner_ops.set_params = dvb_usb_tuner_set_params_i2c;
return -ENODEV;
}
...
<--  snip  -->

Signed-off-by: Patrick Boettcher <pb@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
  • Loading branch information
Adrian Bunk authored and Mauro Carvalho Chehab committed Sep 26, 2006
1 parent 1e805e6 commit 56760f0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/media/dvb/dvb-usb/dibusb-mb.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ static int dibusb_dib3000mb_frontend_attach(struct dvb_usb_device *d)

demod_cfg.demod_address = 0x8;

if ((d->fe = dib3000mb_attach(&demod_cfg,&d->i2c_adap,&st->ops)) == NULL) {
d->fe->ops.tuner_ops.init = dvb_usb_tuner_init_i2c;
d->fe->ops.tuner_ops.set_params = dvb_usb_tuner_set_params_i2c;
if ((d->fe = dib3000mb_attach(&demod_cfg,&d->i2c_adap,&st->ops)) == NULL)
return -ENODEV;
}

d->fe->ops.tuner_ops.init = dvb_usb_tuner_init_i2c;
d->fe->ops.tuner_ops.set_params = dvb_usb_tuner_set_params_i2c;

d->tuner_pass_ctrl = st->ops.tuner_pass_ctrl;

Expand Down

0 comments on commit 56760f0

Please sign in to comment.