Commit 9637b032 authored by Wu, Xia's avatar Wu, Xia Committed by Mauro Carvalho Chehab

[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: default avatarwu xia <xia.wu@intel.com>
Acked-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent f691ba98
...@@ -1220,6 +1220,7 @@ static int __qbuf_dmabuf(struct vb2_buffer *vb, const void *pb) ...@@ -1220,6 +1220,7 @@ static int __qbuf_dmabuf(struct vb2_buffer *vb, const void *pb)
if (planes[plane].length < vb->planes[plane].min_length) { if (planes[plane].length < vb->planes[plane].min_length) {
dprintk(1, "invalid dmabuf length for plane %d\n", dprintk(1, "invalid dmabuf length for plane %d\n",
plane); plane);
dma_buf_put(dbuf);
ret = -EINVAL; ret = -EINVAL;
goto err; goto err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment