From: Mauro Carvalho Chehab Date: Fri, 11 Apr 2008 14:29:44 +0000 (-0300) Subject: V4L/DVB (7537): cx88/saa7134: Fix: avoid OOPS on module unload X-Git-Tag: v2.6.26-rc1~1084^2~175 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9950c1b5b4b86d4aae12853c2f0a0ef11d976764;p=linux-2.6 V4L/DVB (7537): cx88/saa7134: Fix: avoid OOPS on module unload If frontend is not attached, both cx88-dvb and saa7134-dvb don't register DVB. However, dvb unregister were inconditionally called. Due to that, an OOPS is generated. 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 8fc929eb47..e83d9869e6 100644 --- a/drivers/media/video/cx88/cx88-dvb.c +++ b/drivers/media/video/cx88/cx88-dvb.c @@ -951,7 +951,8 @@ static int cx8802_dvb_remove(struct cx8802_driver *drv) struct cx8802_dev *dev = drv->core->dvbdev; /* dvb */ - videobuf_dvb_unregister(&dev->dvb); + if (dev->dvb.frontend) + videobuf_dvb_unregister(&dev->dvb); vp3054_i2c_remove(dev); diff --git a/drivers/media/video/saa7134/saa7134-dvb.c b/drivers/media/video/saa7134/saa7134-dvb.c index 5c84f45ecb..e5c3569dd2 100644 --- a/drivers/media/video/saa7134/saa7134-dvb.c +++ b/drivers/media/video/saa7134/saa7134-dvb.c @@ -1302,7 +1302,8 @@ static int dvb_fini(struct saa7134_dev *dev) } } } - videobuf_dvb_unregister(&dev->dvb); + if (dev->dvb.frontend) + videobuf_dvb_unregister(&dev->dvb); return 0; }