summaryrefslogtreecommitdiffstats
path: root/drivers/media/v4l2-core
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2014-02-28 13:30:48 -0300
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-03-11 06:56:44 -0300
commit9cf3c31a8b63f56066de73695e256b7da96fff1e (patch)
tree246624ae9878a21552eeda124cbabd53c4d092db /drivers/media/v4l2-core
parent3f1a9a33a58eebcc5799d9a6b797e9e19cf8627f (diff)
downloadop-kernel-dev-9cf3c31a8b63f56066de73695e256b7da96fff1e.zip
op-kernel-dev-9cf3c31a8b63f56066de73695e256b7da96fff1e.tar.gz
[media] vb2: call buf_finish after the state check
Don't call buf_finish unless we know that the buffer is in a valid state. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/v4l2-core')
-rw-r--r--drivers/media/v4l2-core/videobuf2-core.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c
index d853cd4..f9059bb 100644
--- a/drivers/media/v4l2-core/videobuf2-core.c
+++ b/drivers/media/v4l2-core/videobuf2-core.c
@@ -1929,8 +1929,6 @@ static int vb2_internal_dqbuf(struct vb2_queue *q, struct v4l2_buffer *b, bool n
if (ret < 0)
return ret;
- call_vb_qop(vb, buf_finish, vb);
-
switch (vb->state) {
case VB2_BUF_STATE_DONE:
dprintk(3, "dqbuf: Returning done buffer\n");
@@ -1943,6 +1941,8 @@ static int vb2_internal_dqbuf(struct vb2_queue *q, struct v4l2_buffer *b, bool n
return -EINVAL;
}
+ call_vb_qop(vb, buf_finish, vb);
+
/* Fill buffer information for the userspace */
__fill_v4l2_buffer(vb, b);
/* Remove from videobuf queue */
OpenPOWER on IntegriCloud