aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx88/cx88-dvb.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2008-04-22 14:45:46 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-24 14:07:48 -0300
commitddd5441df4127d5af45f6b2c58c2020b60bd52de (patch)
tree007c1bd65abf2fe1f4b344463b4c38e1e5b42c5c /drivers/media/video/cx88/cx88-dvb.c
parentf0910c744324e3e853d7a80da876784319d9a1c8 (diff)
downloadlinux-ddd5441df4127d5af45f6b2c58c2020b60bd52de.tar.gz
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 <vanessaezekowitz@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/cx88/cx88-dvb.c')
-rw-r--r--drivers/media/video/cx88/cx88-dvb.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c
index cf6b9b05f49678..d72b817bf886ab 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",