From 483bc6dfc62422269463169947222cab1762c07d Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sat, 17 May 2008 20:20:50 +0000 Subject: [PATCH] Fix a deadlock in the bttv driver From: Arjan van de Ven 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 Signed-off-by: Mauro Carvalho Chehab --- linux/include/media/videobuf-core.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'linux/include') 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); -- cgit v1.2.3 From 3a0a7c3cc611b7e0981fea49e36822133337a9da Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 22 May 2008 19:30:40 +0000 Subject: Remove v4l2_video_std_fps prototype declaration From: Guennadi Liakhovetski The v4l2_video_std_fps function has been removed by Adrian Bunk in 2004 but then its prototype re-appeared in include/media/v4l2-dev.h. Remove it. Signed-off-by: Guennadi Liakhovetski Signed-off-by: Mauro Carvalho Chehab --- linux/include/media/v4l2-dev.h | 1 - 1 file changed, 1 deletion(-) (limited to 'linux/include') diff --git a/linux/include/media/v4l2-dev.h b/linux/include/media/v4l2-dev.h index 42ae06c32..b542b7867 100644 --- a/linux/include/media/v4l2-dev.h +++ b/linux/include/media/v4l2-dev.h @@ -46,7 +46,6 @@ #define VFL_TYPE_VTX 3 /* Video standard functions */ -extern unsigned int v4l2_video_std_fps(struct v4l2_standard *vs); extern char *v4l2_norm_to_name(v4l2_std_id id); extern int v4l2_video_std_construct(struct v4l2_standard *vs, int id, char *name); -- cgit v1.2.3