aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWu, Xia2015-12-09 05:26:26 -0200
committerMauro Carvalho Chehab2016-02-01 07:32:40 -0200
commit9637b03251dea31d99c0742932b9fcbfa015e5f0 (patch)
tree76a165f150469d49977744372badcea728d1706f
parentf691ba9864ad0ed1bd67ad27ed95ed2dce6e15e2 (diff)
[media] media: videobuf2-core: Fix one __qbuf_dmabuf() error path
Add dma_buf_put() to decrease refcount of the dmabuf in error path if DMABUF size is smaller than the requirement. Signed-off-by: wu xia <xia.wu@intel.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@osg.samsung.com>
-rw-r--r--drivers/media/v4l2-core/videobuf2-core.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c
index c5d49d7a0d76..ec5b78ee6e72 100644
--- a/drivers/media/v4l2-core/videobuf2-core.c
+++ b/drivers/media/v4l2-core/videobuf2-core.c
@@ -1220,6 +1220,7 @@ static int __qbuf_dmabuf(struct vb2_buffer *vb, const void *pb)
if (planes[plane].length < vb->planes[plane].min_length) {
dprintk(1, "invalid dmabuf length for plane %d\n",
plane);
+ dma_buf_put(dbuf);
ret = -EINVAL;
goto err;
}