Skip to content

Commit

Permalink
V4L/DVB (5603): V4L: Prevent queueing queued buffers.
Browse files Browse the repository at this point in the history
videobuf_qbuf queues buffers to q->stream but does not properly check
the state of the buffer before queueing. It was possible to queue
buffers that already were in the queue.
Only buffers that are in states STATE_NEEDS_INIT and STATE_IDLE can be
queued.

Signed-off-by: Sakari Ailus <sakari.ailus@nokia.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
  • Loading branch information
Sakari Ailus authored and Mauro Carvalho Chehab committed May 9, 2007
1 parent 5ad5e48 commit 36a63ee
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/media/video/video-buf.c
Original file line number Diff line number Diff line change
Expand Up @@ -702,9 +702,7 @@ videobuf_qbuf(struct videobuf_queue *q,
dprintk(1,"qbuf: memory type is wrong.\n");
goto done;
}
if (buf->state == STATE_QUEUED ||
buf->state == STATE_PREPARED ||
buf->state == STATE_ACTIVE) {
if (buf->state != STATE_NEEDS_INIT && buf->state != STATE_IDLE) {
dprintk(1,"qbuf: buffer is already queued or active.\n");
goto done;
}
Expand Down

0 comments on commit 36a63ee

Please sign in to comment.