From: Wu, Xia Date: Wed, 9 Dec 2015 07:26:26 +0000 (-0200) Subject: [media] media: videobuf2-core: Fix one __qbuf_dmabuf() error path X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=9637b03251dea31d99c0742932b9fcbfa015e5f0;p=linux-beck.git [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 --- 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; }