Skip to content

Commit

Permalink
V4L/DVB (7325): cx88-dvb: fix an OOPS for xc3028 devices, when dvb_at…
Browse files Browse the repository at this point in the history
…tach fails

If dvb_attach fails, dev->dvb.frontend is NULL. This will produce an OOPS, as
reported.

Thanks to Vanessa Ezekowitz <vanessaezekowitz@gmail.com>

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
  • Loading branch information
Mauro Carvalho Chehab committed Apr 24, 2008
1 parent f0910c7 commit ddd5441
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/media/video/cx88/cx88-dvb.c
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,13 @@ static int attach_xc3028(u8 addr, struct cx8802_dev *dev)
.video_dev = dev->core,
};

if (!dev->dvb.frontend) {
printk(KERN_ERR "%s/2: dvb frontend not attached. "
"Can't attach xc3028\n",
dev->core->name);
return -EINVAL;
}

fe = dvb_attach(xc2028_attach, dev->dvb.frontend, &cfg);
if (!fe) {
printk(KERN_ERR "%s/2: xc3028 attach failed\n",
Expand Down

0 comments on commit ddd5441

Please sign in to comment.