diff options
author | Brandon Philips <brandon@ifup.org> | 2008-02-26 23:52:55 -0800 |
---|---|---|
committer | Brandon Philips <brandon@ifup.org> | 2008-02-26 23:52:55 -0800 |
commit | 50078bb28b21b2ffb6ddd69c02a97cf2762661ec (patch) | |
tree | 5f70eb24f88cfd79b65b3197a4025a05bfcab5dc | |
parent | e62b2d9c5b8121e5b6325b2337cb60fd64bfba9c (diff) | |
download | mediapointer-dvb-s2-50078bb28b21b2ffb6ddd69c02a97cf2762661ec.tar.gz mediapointer-dvb-s2-50078bb28b21b2ffb6ddd69c02a97cf2762661ec.tar.bz2 |
v4l: Deadlock in videobuf-core for DQBUF waiting on QBUF
Avoid a deadlock where DQBUF is holding the vb_lock while waiting on a QBUF
which also needs the vb_lock. Reported by Hans Verkuil <hverkuil@xs4all.nl>.
From: Brandon Philips <brandon@ifup.org>
Signed-off-by: Brandon Philips <bphilips@suse.de>
-rw-r--r-- | linux/drivers/media/video/videobuf-core.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/linux/drivers/media/video/videobuf-core.c b/linux/drivers/media/video/videobuf-core.c index b5395c538..86f32545c 100644 --- a/linux/drivers/media/video/videobuf-core.c +++ b/linux/drivers/media/video/videobuf-core.c @@ -606,7 +606,9 @@ int videobuf_dqbuf(struct videobuf_queue *q, goto done; } buf = list_entry(q->stream.next, struct videobuf_buffer, stream); + mutex_unlock(&q->vb_lock); retval = videobuf_waiton(buf, nonblocking, 1); + mutex_lock(&q->vb_lock); if (retval < 0) { dprintk(1, "dqbuf: waiton returned %d\n", retval); goto done; |