linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2] media: s5p_mfc: Release ctx->ctx if failed to allocate ctx->shm
@ 2014-08-05  9:31 Zhaowei Yuan
  2014-08-05 23:32 ` Joonyoung Shim
  0 siblings, 1 reply; 2+ messages in thread
From: Zhaowei Yuan @ 2014-08-05  9:31 UTC (permalink / raw)
  To: linux-media, k.debski, m.chehab, kyungmin.park, jtp.park
  Cc: linux-samsung-soc

ctx->ctx should be released if the following allocation for ctx->shm
gets failed.

Signed-off-by: Zhaowei Yuan <zhaowei.yuan@samsung.com>
---
 drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c |    1 +
 1 file changed, 1 insertion(+)
 mode change 100644 => 100755 drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c

diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c b/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c
old mode 100644
new mode 100755
index 58ec7bb..dc00aea
--- 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;
 	}

--
1.7.9.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH V2] media: s5p_mfc: Release ctx->ctx if failed to allocate ctx->shm
  2014-08-05  9:31 [PATCH V2] media: s5p_mfc: Release ctx->ctx if failed to allocate ctx->shm Zhaowei Yuan
@ 2014-08-05 23:32 ` Joonyoung Shim
  0 siblings, 0 replies; 2+ messages in thread
From: Joonyoung Shim @ 2014-08-05 23:32 UTC (permalink / raw)
  To: Zhaowei Yuan, linux-media, k.debski, m.chehab, kyungmin.park,
	jtp.park
  Cc: linux-samsung-soc

Hi,

On 08/05/2014 06:31 PM, Zhaowei Yuan wrote:
> ctx->ctx should be released if the following allocation for ctx->shm
> gets failed.
> 
> Signed-off-by: Zhaowei Yuan <zhaowei.yuan@samsung.com>
> ---
>  drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c |    1 +
>  1 file changed, 1 insertion(+)
>  mode change 100644 => 100755 drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c

It's wrong to change file permission, please don't make a same mistake.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-08-05 23:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-05  9:31 [PATCH V2] media: s5p_mfc: Release ctx->ctx if failed to allocate ctx->shm Zhaowei Yuan
2014-08-05 23:32 ` Joonyoung Shim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).