summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@linux.intel.com>2008-05-20 09:53:52 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2008-06-16 13:20:06 -0700
commit69f24455cf25d776f8b19d06c7a43a8185fc633d (patch)
tree6bc8f3832dfe5274bbc1c7ff51aed893f119e255 /include
parentc7559a1531958785bdc25363f8cde154011c0f9d (diff)
bttv: Fix a deadlock in the bttv driver
commit 81b2dbcad86732ffc02bad87aa25c4651199fc77 in mainline. 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. Acked-by: Mauro Carvalho Chehab <mchehab@infradead.org> Reported-by: Koos Vriezen <koos.vriezen@gmail.com> Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include')
-rw-r--r--include/media/videobuf-core.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/media/videobuf-core.h b/include/media/videobuf-core.h
index 99033945cdee..755273137609 100644
--- a/include/media/videobuf-core.h
+++ b/include/media/videobuf-core.h
@@ -227,6 +227,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);