aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/v4l2-core/videobuf2-core.c
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2014-02-28 11:30:48 -0500
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-03-11 05:56:44 -0400
commit9cf3c31a8b63f56066de73695e256b7da96fff1e (patch)
tree246624ae9878a21552eeda124cbabd53c4d092db /drivers/media/v4l2-core/videobuf2-core.c
parent3f1a9a33a58eebcc5799d9a6b797e9e19cf8627f (diff)
[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/videobuf2-core.c')
-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 d853cd47c86a..f9059bb73840 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
1929 if (ret < 0) 1929 if (ret < 0)
1930 return ret; 1930 return ret;
1931 1931
1932 call_vb_qop(vb, buf_finish, vb);
1933
1934 switch (vb->state) { 1932 switch (vb->state) {
1935 case VB2_BUF_STATE_DONE: 1933 case VB2_BUF_STATE_DONE:
1936 dprintk(3, "dqbuf: Returning done buffer\n"); 1934 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
1943 return -EINVAL; 1941 return -EINVAL;
1944 } 1942 }
1945 1943
1944 call_vb_qop(vb, buf_finish, vb);
1945
1946 /* Fill buffer information for the userspace */ 1946 /* Fill buffer information for the userspace */
1947 __fill_v4l2_buffer(vb, b); 1947 __fill_v4l2_buffer(vb, b);
1948 /* Remove from videobuf queue */ 1948 /* Remove from videobuf queue */