mirror of https://gitee.com/openkylin/linux.git
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>
This commit is contained in:
parent
3863d4bb55
commit
e641e02d78
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue