From: Devin Heitmueller Date: Wed, 11 Mar 2009 06:01:02 +0000 (-0300) Subject: V4L/DVB (11079): au0828: fix panic on disconnect if analog initialization failed X-Git-Tag: MMI-PSA29.97-13-9~29189^2~186 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2eaf396020555973cad7aa5b517c2418eccbca50;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git V4L/DVB (11079): au0828: fix panic on disconnect if analog initialization failed If the analog initialization failed to create the video device, we never actually add the entry to the au0828_devlist. Therefore a panic occurs when unregistering the analog subsystem. Make it so we only remove the entry from the list if we added it to the list in the first place. Signed-off-by: Devin Heitmueller Signed-off-by: Michael Krufky Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/au0828/au0828-video.c b/drivers/media/video/au0828/au0828-video.c index 4c77aebfe6ee..6abdd8bf4494 100644 --- a/drivers/media/video/au0828/au0828-video.c +++ b/drivers/media/video/au0828/au0828-video.c @@ -700,9 +700,10 @@ void au0828_analog_unregister(struct au0828_dev *dev) dprintk(1, "au0828_release_resources called\n"); mutex_lock(&au0828_sysfs_lock); - list_del(&dev->au0828list); - if (dev->vdev) + if (dev->vdev) { + list_del(&dev->au0828list); video_unregister_device(dev->vdev); + } if (dev->vbi_dev) video_unregister_device(dev->vbi_dev);