summaryrefslogtreecommitdiff
path: root/linux/include/media
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2008-05-17 20:20:50 +0000
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-05-17 20:20:50 +0000
commit483bc6dfc62422269463169947222cab1762c07d (patch)
tree57155bd480c258f942412655e7e29f320dfdf481 /linux/include/media
parent05da578ca1e11f37b78f9821a7c26dcd603fb5bb (diff)
downloadmediapointer-dvb-s2-483bc6dfc62422269463169947222cab1762c07d.tar.gz
mediapointer-dvb-s2-483bc6dfc62422269463169947222cab1762c07d.tar.bz2
[PATCH] Fix a deadlock in the bttv driver
From: Arjan van de Ven <arjan@linux.intel.com> vidiocgmbuf() does this: mutex_lock(&fh->cap.vb_lock); retval = videobuf_mmap_setup(&fh->cap, gbuffers, gbufsize, V4L2_MEMORY_MMAP); and videobuf_mmap_setup() then just does mutex_lock(&q->vb_lock); ret = __videobuf_mmap_setup(q, bcount, bsize, memory); mutex_unlock(&q->vb_lock); which is an obvious double-take deadlock. This patch fixes this by having vidiocgmbuf() just call the __videobuf_mmap_setup function instead. Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux/include/media')
-rw-r--r--linux/include/media/videobuf-core.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/linux/include/media/videobuf-core.h b/linux/include/media/videobuf-core.h
index dd0821f40..a2f55ff24 100644
--- a/linux/include/media/videobuf-core.h
+++ b/linux/include/media/videobuf-core.h
@@ -241,6 +241,9 @@ unsigned int videobuf_poll_stream(struct file *file,
int videobuf_mmap_setup(struct videobuf_queue *q,
unsigned int bcount, unsigned int bsize,
enum v4l2_memory memory);
+int __videobuf_mmap_setup(struct videobuf_queue *q,
+ unsigned int bcount, unsigned int bsize,
+ enum v4l2_memory memory);
int videobuf_mmap_free(struct videobuf_queue *q);
int videobuf_mmap_mapper(struct videobuf_queue *q,
struct vm_area_struct *vma);