[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1505893033-7491-2-git-send-email-arvind.yadav.cs@gmail.com>
Date: Wed, 20 Sep 2017 13:07:12 +0530
From: Arvind Yadav <arvind.yadav.cs@...il.com>
To: p.zabel@...gutronix.de, mchehab@...nel.org, hans.verkuil@...co.com,
sean@...s.org, andi.shyti@...sung.com
Cc: linux-media@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH 1/2] [media] coda: Handle return value of kasprintf
kasprintf() can fail here and we must check its return value.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@...il.com>
---
drivers/media/platform/coda/coda-bit.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/media/platform/coda/coda-bit.c b/drivers/media/platform/coda/coda-bit.c
index 291c409..8d78183 100644
--- a/drivers/media/platform/coda/coda-bit.c
+++ b/drivers/media/platform/coda/coda-bit.c
@@ -417,6 +417,9 @@ static int coda_alloc_framebuffers(struct coda_ctx *ctx,
dev->devtype->product != CODA_DX6)
size += ysize / 4;
name = kasprintf(GFP_KERNEL, "fb%d", i);
+ if (!name)
+ return -ENOMEM;
+
ret = coda_alloc_context_buf(ctx, &ctx->internal_frames[i],
size, name);
kfree(name);
--
1.9.1
Powered by blists - more mailing lists