提交 e43d76b4 编写于 作者: B Brandon Philips 提交者: Mauro Carvalho Chehab

V4L/DVB (7281): 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>.
Signed-off-by: NBrandon Philips <bphilips@suse.de>
Signed-off-by: NMauro Carvalho Chehab <mchehab@infradead.org>
上级 9dc4e48f
...@@ -605,7 +605,9 @@ int videobuf_dqbuf(struct videobuf_queue *q, ...@@ -605,7 +605,9 @@ int videobuf_dqbuf(struct videobuf_queue *q,
goto done; goto done;
} }
buf = list_entry(q->stream.next, struct videobuf_buffer, stream); buf = list_entry(q->stream.next, struct videobuf_buffer, stream);
mutex_unlock(&q->vb_lock);
retval = videobuf_waiton(buf, nonblocking, 1); retval = videobuf_waiton(buf, nonblocking, 1);
mutex_lock(&q->vb_lock);
if (retval < 0) { if (retval < 0) {
dprintk(1, "dqbuf: waiton returned %d\n", retval); dprintk(1, "dqbuf: waiton returned %d\n", retval);
goto done; goto done;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册