From b898770b70b72c9cacc1b39e0bd6f84c7744ce01 Mon Sep 17 00:00:00 2001 From: Zhaowei Yuan Date: Fri, 1 Aug 2014 14:05:41 +0800 Subject: [PATCH] media: s5p_mfc: Release ctx->ctx if failed to allocate ctx->shm ctx->ctx should be released when the following allocation for ctx->shm fails. Change-Id: I55372f8360db4605a65f633393b97c0ba2ee47d6 Signed-off-by: Zhaowei Yuan --- drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c b/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c index 3315c48..422a372 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c @@ -228,6 +228,7 @@ static int s5p_mfc_alloc_instance_buffer_v5(struct s5p_mfc_ctx *ctx) ret = s5p_mfc_alloc_priv_buf(dev->mem_dev_l, &ctx->shm); if (ret) { mfc_err("Failed to allocate shared memory buffer\n"); + s5p_mfc_release_priv_buf(dev->mem_dev_l, &ctx->ctx); return ret; } -- 2.7.4