From: Mauro Carvalho Chehab Date: Tue, 22 Apr 2008 17:45:46 +0000 (-0300) Subject: V4L/DVB (7325): cx88-dvb: fix an OOPS for xc3028 devices, when dvb_attach fails X-Git-Tag: v2.6.26-rc1~1084^2~342 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ddd5441df4127d5af45f6b2c58c2020b60bd52de;p=linux-2.6 V4L/DVB (7325): cx88-dvb: fix an OOPS for xc3028 devices, when dvb_attach fails If dvb_attach fails, dev->dvb.frontend is NULL. This will produce an OOPS, as reported. Thanks to Vanessa Ezekowitz Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c index cf6b9b05f4..d72b817bf8 100644 --- a/drivers/media/video/cx88/cx88-dvb.c +++ b/drivers/media/video/cx88/cx88-dvb.c @@ -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",