From 9637b03251dea31d99c0742932b9fcbfa015e5f0 Mon Sep 17 00:00:00 2001 From: "Wu, Xia" Date: Wed, 9 Dec 2015 05:26:26 -0200 Subject: [PATCH] [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 Acked-by: Sakari Ailus Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/media/v4l2-core/videobuf2-core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c index c5d49d7..ec5b78e 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; } -- 2.7.4