]> git.baikalelectronics.ru Git - kernel.git/commit
media: videobuf2-v4l2.c: move up STATE_DEQUEUED check
authorHans Verkuil <hverkuil@xs4all.nl>
Mon, 1 Apr 2019 12:41:58 +0000 (08:41 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Mon, 22 Apr 2019 15:43:00 +0000 (11:43 -0400)
commitf72b07324c4a39de76f326aee567027a04f82747
treea39a33b9441e6b7905120109a19947480a305bc9
parent34c8d2da1b9a00a890ca70c1c0a44aa64072eddc
media: videobuf2-v4l2.c: move up STATE_DEQUEUED check

If a buffer is queued to a request, followed by an attempt to queue
the same buffer again, then the second qbuf returns an error since
the buffer is not in the DEQUEUED state anymore.

However, before it gets to that check it executes the code under the
'if (!vb->prepared)' condition. This clears previously set data needed
for request handling, and now querybuf will no longer report that this
buffer is part of a request.

Move the state check to before the 'if' and make sure to only do the
state check when called from QBUF and if V4L2_BUF_FLAG_REQUEST_FD is
set.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/common/videobuf2/videobuf2-v4l2.c