]> err.no Git - linux-2.6/commitdiff
V4L/DVB (7624): Avoid an oops if the board is not fully defined
authorSteven Toth <stoth@hauppauge.com>
Wed, 2 Apr 2008 04:10:40 +0000 (01:10 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Thu, 24 Apr 2008 17:09:43 +0000 (14:09 -0300)
Avoid an oops if the board is not fully defined.

Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/au0828/au0828-core.c
drivers/media/video/au0828/au0828-dvb.c

index f5df99ea3b9fb740c095e90e02c99a7e99a76020..a3410fc8f5f9154d403997a4fcbc1260cf6325db 100644 (file)
@@ -217,6 +217,7 @@ static int au0828_usb_probe (struct usb_interface *interface,
        au0828_dvb_register(dev);
 
        _info("Registered device AU0828 [%s]\n",
+               au0828_boards[dev->board].name == NULL ? "Unset" :
                au0828_boards[dev->board].name);
 
        return 0;
index 3c8a29eafc2d074140bbf1f8a3f080c4d07f2d4d..ecc08a8e31cacf10e17299e6f137de1193a68968 100644 (file)
@@ -57,6 +57,9 @@ static void urb_completion(struct urb *purb)
        struct au0828_dev *dev = purb->context;
        int ptype = usb_pipetype(purb->pipe);
 
+       if (!dev)
+               return;
+
        if (dev->urb_streaming == 0)
                return;
 
@@ -310,6 +313,9 @@ void au0828_dvb_unregister(struct au0828_dev *dev)
 {
        struct au0828_dvb *dvb = &dev->dvb;
 
+       if(dvb->frontend == NULL)
+               return;
+
        dvb_net_release(&dvb->net);
        dvb->demux.dmx.remove_frontend(&dvb->demux.dmx, &dvb->fe_mem);
        dvb->demux.dmx.remove_frontend(&dvb->demux.dmx, &dvb->fe_hw);