[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>
This commit is contained in:
Wu, Xia 2015-12-09 05:26:26 -02:00 committed by Mauro Carvalho Chehab
parent f691ba9864
commit 9637b03251

View File

@ -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;
}