summaryrefslogtreecommitdiff
path: root/drivers/media/video/hdpvr/hdpvr-video.c
diff options
context:
space:
mode:
authorJiri Slaby <jirislaby@gmail.com>2009-07-31 03:00:44 +0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-09-12 19:18:30 +0400
commit00c1e2167e3163d2e193644b7d768f06d2a8c279 (patch)
tree12ce3218cfea21b3127400aa741b54f1ee236e60 /drivers/media/video/hdpvr/hdpvr-video.c
parentb9ab3508efa57905ae037ddf48c97ea6ed74b799 (diff)
downloadlinux-00c1e2167e3163d2e193644b7d768f06d2a8c279.tar.xz
V4L/DVB (12373): hdpvr: fix lock imbalances
There are many lock imbalances in this driver. Fix all found. Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/hdpvr/hdpvr-video.c')
-rw-r--r--drivers/media/video/hdpvr/hdpvr-video.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/media/video/hdpvr/hdpvr-video.c b/drivers/media/video/hdpvr/hdpvr-video.c
index d678765cbba2..2eb9dc2ebe59 100644
--- a/drivers/media/video/hdpvr/hdpvr-video.c
+++ b/drivers/media/video/hdpvr/hdpvr-video.c
@@ -375,6 +375,7 @@ static int hdpvr_open(struct file *file)
* in resumption */
mutex_lock(&dev->io_mutex);
dev->open_count++;
+ mutex_unlock(&dev->io_mutex);
fh->dev = dev;
@@ -383,7 +384,6 @@ static int hdpvr_open(struct file *file)
retval = 0;
err:
- mutex_unlock(&dev->io_mutex);
return retval;
}
@@ -519,8 +519,10 @@ static unsigned int hdpvr_poll(struct file *filp, poll_table *wait)
mutex_lock(&dev->io_mutex);
- if (video_is_unregistered(dev->video_dev))
+ if (video_is_unregistered(dev->video_dev)) {
+ mutex_unlock(&dev->io_mutex);
return -EIO;
+ }
if (dev->status == STATUS_IDLE) {
if (hdpvr_start_streaming(dev)) {