summaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorArvind Yadav <arvind.yadav.cs@gmail.com>2017-09-20 11:40:58 +0200
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2017-10-27 14:09:39 +0200
commite641e02d78682f7749053d84d1729c5e37655ff9 (patch)
tree322283e2638a43c280f4736f8223a79985a55b1d /drivers/media
parentmedia: i2c: tc358743: fix spelling mistake (diff)
downloadlinux-e641e02d78682f7749053d84d1729c5e37655ff9.tar.xz
linux-e641e02d78682f7749053d84d1729c5e37655ff9.zip
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@gmail.com> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/platform/coda/coda-bit.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/media/platform/coda/coda-bit.c b/drivers/media/platform/coda/coda-bit.c
index 291c40933935..bfc4ecf6f068 100644
--- a/drivers/media/platform/coda/coda-bit.c
+++ b/drivers/media/platform/coda/coda-bit.c
@@ -417,6 +417,10 @@ 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) {
+ coda_free_framebuffers(ctx);
+ return -ENOMEM;
+ }
ret = coda_alloc_context_buf(ctx, &ctx->internal_frames[i],
size, name);
kfree(name);