[COMMON] media: mfc: fix the plane number check.
authorJeonghee Kim <jhhhh.kim@samsung.com>
Mon, 28 May 2018 11:56:17 +0000 (20:56 +0900)
committerCosmin Tanislav <demonsingur@gmail.com>
Mon, 22 Apr 2024 17:22:23 +0000 (20:22 +0300)
In the DRM encoder scenario, a dma_buf with null value was used.
get_dmabuf should be called according to the number of fds,
not the number of planes.

Change-Id: Ia7eb1c2eb1b57712b2376d82fec78de8d3418d07
Signed-off-by: Jeonghee Kim <jhhhh.kim@samsung.com>
drivers/media/platform/exynos/mfc/s5p_mfc_enc_vb2_ops.c

index db868b3a155eba78071708bc4157e102d39e64a0..df3bfe47aba4e196b2acdb0ced62b6e67cfd056c 100644 (file)
@@ -197,7 +197,7 @@ static int s5p_mfc_enc_buf_prepare(struct vb2_buffer *vb)
                        }
                }
 
-               for (i = 0; i < ctx->src_fmt->num_planes; i++) {
+               for (i = 0; i < ctx->src_fmt->mem_planes; i++) {
                        dmabuf = s5p_mfc_mem_get_dmabuf(vb->planes[i].m.fd);
                        if (!dmabuf)
                                return -ENOMEM;