aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/bt8xx
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2010-09-18 07:35:57 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-10-20 23:06:12 -0400
commitca960bfe136844952041d2e7dc030a6d4d5c7469 (patch)
tree27a4a221c8c3f133e37b7ecca9c9daf9e8aac3b8 /drivers/media/video/bt8xx
parent8822f0d60b7cd550465e7d07dbe02084f5476d91 (diff)
V4L/DVB: bttv: Fix mutex unbalance at bttv_poll
Don't do double mutex_unlock when reading a stream at bttv_poll. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/bt8xx')
-rw-r--r--drivers/media/video/bt8xx/bttv-driver.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c
index fcafe2f1e5cf..d74dfa6d1a55 100644
--- a/drivers/media/video/bt8xx/bttv-driver.c
+++ b/drivers/media/video/bt8xx/bttv-driver.c
@@ -3162,15 +3162,14 @@ static unsigned int bttv_poll(struct file *file, poll_table *wait)
3162 return videobuf_poll_stream(file, &fh->vbi, wait); 3162 return videobuf_poll_stream(file, &fh->vbi, wait);
3163 } 3163 }
3164 3164
3165 mutex_lock(&fh->cap.vb_lock);
3165 if (check_btres(fh,RESOURCE_VIDEO_STREAM)) { 3166 if (check_btres(fh,RESOURCE_VIDEO_STREAM)) {
3166 mutex_lock(&fh->cap.vb_lock);
3167 /* streaming capture */ 3167 /* streaming capture */
3168 if (list_empty(&fh->cap.stream)) 3168 if (list_empty(&fh->cap.stream))
3169 goto err; 3169 goto err;
3170 buf = list_entry(fh->cap.stream.next,struct bttv_buffer,vb.stream); 3170 buf = list_entry(fh->cap.stream.next,struct bttv_buffer,vb.stream);
3171 } else { 3171 } else {
3172 /* read() capture */ 3172 /* read() capture */
3173 mutex_lock(&fh->cap.vb_lock);
3174 if (NULL == fh->cap.read_buf) { 3173 if (NULL == fh->cap.read_buf) {
3175 /* need to capture a new frame */ 3174 /* need to capture a new frame */
3176 if (locked_btres(fh->btv,RESOURCE_VIDEO_STREAM)) 3175 if (locked_btres(fh->btv,RESOURCE_VIDEO_STREAM))
@@ -3188,7 +3187,6 @@ static unsigned int bttv_poll(struct file *file, poll_table *wait)
3188 fh->cap.ops->buf_queue(&fh->cap,fh->cap.read_buf); 3187 fh->cap.ops->buf_queue(&fh->cap,fh->cap.read_buf);
3189 fh->cap.read_off = 0; 3188 fh->cap.read_off = 0;
3190 } 3189 }
3191 mutex_unlock(&fh->cap.vb_lock);
3192 buf = (struct bttv_buffer*)fh->cap.read_buf; 3190 buf = (struct bttv_buffer*)fh->cap.read_buf;
3193 } 3191 }
3194 3192