Skip to content

Commit

Permalink
media: videobuf2-core: check for q->error in vb2_core_qbuf()
Browse files Browse the repository at this point in the history
The vb2_core_qbuf() function didn't check if q->error was set. It is
checked in __buf_prepare(), but that function isn't called if the buffer
was already prepared before with VIDIOC_PREPARE_BUF.

So check it at the start of vb2_core_qbuf() as well.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
  • Loading branch information
hverkuil authored and mchehab committed Jul 24, 2018
1 parent a50c773 commit b509d73
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/media/common/videobuf2/videobuf2-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1377,6 +1377,11 @@ int vb2_core_qbuf(struct vb2_queue *q, unsigned int index, void *pb)
struct vb2_buffer *vb;
int ret;

if (q->error) {
dprintk(1, "fatal error occurred on queue\n");
return -EIO;
}

vb = q->bufs[index];

switch (vb->state) {
Expand Down

0 comments on commit b509d73

Please sign in to comment.