From: Steven Toth Date: Wed, 2 Apr 2008 04:10:40 +0000 (-0300) Subject: V4L/DVB (7624): Avoid an oops if the board is not fully defined X-Git-Tag: v2.6.26-rc1~1084^2~99 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9c26de555dd3c2cb9833b4d324150aa6b5547b91;p=linux-2.6 V4L/DVB (7624): Avoid an oops if the board is not fully defined Avoid an oops if the board is not fully defined. Signed-off-by: Steven Toth Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/au0828/au0828-core.c b/drivers/media/video/au0828/au0828-core.c index f5df99ea3b..a3410fc8f5 100644 --- a/drivers/media/video/au0828/au0828-core.c +++ b/drivers/media/video/au0828/au0828-core.c @@ -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; diff --git a/drivers/media/video/au0828/au0828-dvb.c b/drivers/media/video/au0828/au0828-dvb.c index 3c8a29eafc..ecc08a8e31 100644 --- a/drivers/media/video/au0828/au0828-dvb.c +++ b/drivers/media/video/au0828/au0828-dvb.c @@ -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);