aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/hdpvr/hdpvr-core.c
diff options
context:
space:
mode:
authorJanne Grunau <j@jannau.net>2009-03-26 20:56:06 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-03-30 12:43:42 -0300
commit48f98f7557d35d360470bf6d9fd7b00d04fba828 (patch)
tree8231070b0a8fce217cc061ac50979afd1ef72294 /drivers/media/video/hdpvr/hdpvr-core.c
parentd2ff3ec81628cbf9470c496b3d0c0780165643f5 (diff)
downloadkernel_samsung_smdk4412-48f98f7557d35d360470bf6d9fd7b00d04fba828.zip
kernel_samsung_smdk4412-48f98f7557d35d360470bf6d9fd7b00d04fba828.tar.gz
kernel_samsung_smdk4412-48f98f7557d35d360470bf6d9fd7b00d04fba828.tar.bz2
V4L/DVB (11231): hdpvr: locking fixes
unlock io_mutex in hdpvr_stop_streaming hdpvr_disconnect to allow the streaming worker to stop before we flush the workqueue. do not return to user space with mutex held in vidioc_encoder_cmd with an unknown encoder command. Signed-off-by: Janne Grunau <j@jannau.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/hdpvr/hdpvr-core.c')
-rw-r--r--drivers/media/video/hdpvr/hdpvr-core.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/media/video/hdpvr/hdpvr-core.c b/drivers/media/video/hdpvr/hdpvr-core.c
index 2c49862..547833e 100644
--- a/drivers/media/video/hdpvr/hdpvr-core.c
+++ b/drivers/media/video/hdpvr/hdpvr-core.c
@@ -390,8 +390,10 @@ static void hdpvr_disconnect(struct usb_interface *interface)
video_unregister_device(dev->video_dev);
wake_up_interruptible(&dev->wait_data);
wake_up_interruptible(&dev->wait_buffer);
+ mutex_unlock(&dev->io_mutex);
msleep(100);
flush_workqueue(dev->workqueue);
+ mutex_lock(&dev->io_mutex);
hdpvr_cancel_queue(dev);
destroy_workqueue(dev->workqueue);
mutex_unlock(&dev->io_mutex);