From 10fd27b598ce42b251b665f6922961ddac7ff90e Mon Sep 17 00:00:00 2001 From: Devin Heitmueller Date: Wed, 11 Mar 2009 02:01:02 -0400 Subject: au0828: fix panic on disconnect if analog initialization failed From: Devin Heitmueller 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. Priority: normal Signed-off-by: Devin Heitmueller Signed-off-by: Michael Krufky --- linux/drivers/media/video/au0828/au0828-video.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'linux/drivers/media/video/au0828') diff --git a/linux/drivers/media/video/au0828/au0828-video.c b/linux/drivers/media/video/au0828/au0828-video.c index e75b8b530..b9ce10508 100644 --- a/linux/drivers/media/video/au0828/au0828-video.c +++ b/linux/drivers/media/video/au0828/au0828-video.c @@ -704,9 +704,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); -- cgit v1.2.3