From 283470b27fe4c413f992a0830885273c8d08fdf8 Mon Sep 17 00:00:00 2001 From: Sunyoung Kang Date: Thu, 9 Nov 2017 17:20:24 +0900 Subject: [PATCH] media: mfc: add missed put_dmabuf When using dmabuf container, put_dmabuf() was missed and it is memory leak. So this adds put_dmabuf(). Change-Id: Ib0cf13f99409cebff5d5ca9af6a3c424776061ba Signed-off-by: Sunyoung Kang --- drivers/media/platform/exynos/mfc/s5p_mfc_enc_vb2_ops.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/media/platform/exynos/mfc/s5p_mfc_enc_vb2_ops.c b/drivers/media/platform/exynos/mfc/s5p_mfc_enc_vb2_ops.c index 56c8d61587cf..a1d954533f89 100644 --- a/drivers/media/platform/exynos/mfc/s5p_mfc_enc_vb2_ops.c +++ b/drivers/media/platform/exynos/mfc/s5p_mfc_enc_vb2_ops.c @@ -161,6 +161,7 @@ static int s5p_mfc_enc_buf_init(struct vb2_buffer *vb) count = s5p_mfc_bufcon_get_daddr(ctx, buf, dmabuf, i); if (count != ctx->num_bufs_in_vb) { + s5p_mfc_mem_put_dmabuf(dmabuf); mfc_err_ctx("invalid buffer count %d != num_bufs_in_vb %d\n", count, ctx->num_bufs_in_vb); return -EFAULT; @@ -170,6 +171,7 @@ static int s5p_mfc_enc_buf_init(struct vb2_buffer *vb) } else { dma_addr_t start_raw; + s5p_mfc_mem_put_dmabuf(dmabuf); start_raw = s5p_mfc_mem_get_daddr_vb(vb, 0); if (start_raw == 0) { mfc_err_ctx("Plane mem not allocated.\n"); -- 2.20.1