提交 36a63ee3 编写于 作者: S Sakari Ailus 提交者: Mauro Carvalho Chehab

V4L/DVB (5603): V4L: Prevent queueing queued buffers.

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: NSakari Ailus <sakari.ailus@nokia.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@infradead.org>
上级 5ad5e484
...@@ -702,9 +702,7 @@ videobuf_qbuf(struct videobuf_queue *q, ...@@ -702,9 +702,7 @@ videobuf_qbuf(struct videobuf_queue *q,
dprintk(1,"qbuf: memory type is wrong.\n"); dprintk(1,"qbuf: memory type is wrong.\n");
goto done; goto done;
} }
if (buf->state == STATE_QUEUED || if (buf->state != STATE_NEEDS_INIT && buf->state != STATE_IDLE) {
buf->state == STATE_PREPARED ||
buf->state == STATE_ACTIVE) {
dprintk(1,"qbuf: buffer is already queued or active.\n"); dprintk(1,"qbuf: buffer is already queued or active.\n");
goto done; goto done;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册