From 7d87db3df00ccc138d6243ec12eb354e9c3f48ec Mon Sep 17 00:00:00 2001 From: "Lad, Prabhakar" Date: Sat, 7 Mar 2015 12:30:50 -0300 Subject: [PATCH] [media] media: am437x-vpfe: return error in case memory allocation failure return error in case devm_kzalloc() fails. Signed-off-by: Lad, Prabhakar Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/media/platform/am437x/am437x-vpfe.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/media/platform/am437x/am437x-vpfe.c b/drivers/media/platform/am437x/am437x-vpfe.c index 7ea08308f03d..006e9e867239 100644 --- a/drivers/media/platform/am437x/am437x-vpfe.c +++ b/drivers/media/platform/am437x/am437x-vpfe.c @@ -2501,6 +2501,12 @@ vpfe_get_pdata(struct platform_device *pdev) pdata->asd[i] = devm_kzalloc(&pdev->dev, sizeof(struct v4l2_async_subdev), GFP_KERNEL); + if (!pdata->asd[i]) { + of_node_put(rem); + pdata = NULL; + goto done; + } + pdata->asd[i]->match_type = V4L2_ASYNC_MATCH_OF; pdata->asd[i]->match.of.node = rem; of_node_put(endpoint); -- 2.34.1