Skip to content

Commit

Permalink
V4L/DVB (7281): v4l: Deadlock in videobuf-core for DQBUF waiting on QBUF
Browse files Browse the repository at this point in the history
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: Brandon Philips <bphilips@suse.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
  • Loading branch information
Brandon Philips authored and Mauro Carvalho Chehab committed Apr 24, 2008
1 parent 9dc4e48 commit e43d76b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/media/video/videobuf-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,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;
Expand Down

0 comments on commit e43d76b

Please sign in to comment.