Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

[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
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -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;
		}
		}