From c55e8176a27723c16157754f8e6c968917f1c0a7 Mon Sep 17 00:00:00 2001 From: Ayoung Sim Date: Wed, 18 Jul 2018 16:52:07 +0900 Subject: [PATCH] [COMMON] media: mfc: add the error handling If there is no valid buffer in mask bit, we couldn't do encoding Change-Id: I94722a348cd6e192cd6195d6f506fc480b79145e Signed-off-by: Ayoung Sim --- drivers/media/platform/exynos/mfc/mfc_mem.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/media/platform/exynos/mfc/mfc_mem.c b/drivers/media/platform/exynos/mfc/mfc_mem.c index ab157a1855eb..e9423d3743cc 100644 --- a/drivers/media/platform/exynos/mfc/mfc_mem.c +++ b/drivers/media/platform/exynos/mfc/mfc_mem.c @@ -225,6 +225,12 @@ int mfc_bufcon_get_daddr(struct mfc_ctx *ctx, struct mfc_buf *mfc_buf, mfc_err_ctx("[BUFCON] it is not buffer container\n"); return -1; } + + if (mask == 0) { + mfc_err_ctx("[BUFCON] number of valid buffers is zero\n"); + return -1; + } + mfc_debug(3, "[BUFCON] bufcon mask info %#x\n", mask); for (i = 0; i < mfc_buf->num_bufs_in_batch; i++) { -- 2.20.1