Commit e641e02d authored by Arvind Yadav's avatar Arvind Yadav Committed by Mauro Carvalho Chehab

media: coda: Handle return value of kasprintf

kasprintf() can fail here and we must check its return value.
Signed-off-by: default avatarArvind Yadav <arvind.yadav.cs@gmail.com>
Reviewed-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 3863d4bb
...@@ -417,6 +417,10 @@ static int coda_alloc_framebuffers(struct coda_ctx *ctx, ...@@ -417,6 +417,10 @@ static int coda_alloc_framebuffers(struct coda_ctx *ctx,
dev->devtype->product != CODA_DX6) dev->devtype->product != CODA_DX6)
size += ysize / 4; size += ysize / 4;
name = kasprintf(GFP_KERNEL, "fb%d", i); 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], ret = coda_alloc_context_buf(ctx, &ctx->internal_frames[i],
size, name); size, name);
kfree(name); kfree(name);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment