From: Sunyoung Kang Date: Thu, 9 Nov 2017 08:20:24 +0000 (+0900) Subject: media: mfc: add missed put_dmabuf X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0ba0677e3cef62710513210699e876e1074a7901;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 --- 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");