]> err.no Git - linux-2.6/commitdiff
V4L/DVB (7537): cx88/saa7134: Fix: avoid OOPS on module unload
authorMauro Carvalho Chehab <mchehab@infradead.org>
Fri, 11 Apr 2008 14:29:44 +0000 (11:29 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Thu, 24 Apr 2008 17:08:00 +0000 (14:08 -0300)
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 <mchehab@infradead.org>
drivers/media/video/cx88/cx88-dvb.c
drivers/media/video/saa7134/saa7134-dvb.c

index 8fc929eb47ba915559d41101d40d19949f6fc29f..e83d9869e68ba05351659c1e66a4199e36f54b50 100644 (file)
@@ -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);
 
index 5c84f45ecbe2a611cc58d23450d137046ff47cb5..e5c3569dd2c831bc6f9eeaf4eb97f616b5769c0e 100644 (file)
@@ -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;
 }