diff options
author | Patrick Boettcher <pb@linuxtv.org> | 2006-08-15 16:38:40 +0200 |
---|---|---|
committer | Patrick Boettcher <pb@linuxtv.org> | 2006-08-15 16:38:40 +0200 |
commit | 04e963dbabd077673fbc46b533246190aebb95b5 (patch) | |
tree | c183c73524c7cce3d90465df332b2543f7f906c9 | |
parent | 8d1d7873e0e1bc9f927f8c4e22c35279fde0f085 (diff) | |
download | mediapointer-dvb-s2-04e963dbabd077673fbc46b533246190aebb95b5.tar.gz mediapointer-dvb-s2-04e963dbabd077673fbc46b533246190aebb95b5.tar.bz2 |
drivers/media/dvb/dvb-usb/dibusb-mb.c: NULL dereference
From: Adrian Bunk <bunk@stusta.de>
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>
-rw-r--r-- | linux/drivers/media/dvb/dvb-usb/dibusb-mb.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/linux/drivers/media/dvb/dvb-usb/dibusb-mb.c b/linux/drivers/media/dvb/dvb-usb/dibusb-mb.c index b4efa3772..f762d175f 100644 --- a/linux/drivers/media/dvb/dvb-usb/dibusb-mb.c +++ b/linux/drivers/media/dvb/dvb-usb/dibusb-mb.c @@ -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; |