Skip to content

Commit

Permalink
[media] vb2: fix PREPARE_BUF regression
Browse files Browse the repository at this point in the history
Fix an incorrect test in vb2_internal_qbuf() where only DEQUEUED buffers
are allowed. But PREPARED buffers are also OK.

Introduced by commit 4138111
("vb2: simplify qbuf/prepare_buf by removing callback").

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Mar 11, 2014
1 parent 4e5a4d8 commit 952c9ee
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions drivers/media/v4l2-core/videobuf2-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1459,11 +1459,6 @@ static int vb2_internal_qbuf(struct vb2_queue *q, struct v4l2_buffer *b)
return ret;

vb = q->bufs[b->index];
if (vb->state != VB2_BUF_STATE_DEQUEUED) {
dprintk(1, "%s(): invalid buffer state %d\n", __func__,
vb->state);
return -EINVAL;
}

switch (vb->state) {
case VB2_BUF_STATE_DEQUEUED:
Expand All @@ -1477,7 +1472,8 @@ static int vb2_internal_qbuf(struct vb2_queue *q, struct v4l2_buffer *b)
dprintk(1, "qbuf: buffer still being prepared\n");
return -EINVAL;
default:
dprintk(1, "qbuf: buffer already in use\n");
dprintk(1, "%s(): invalid buffer state %d\n", __func__,
vb->state);
return -EINVAL;
}

Expand Down

0 comments on commit 952c9ee

Please sign in to comment.