From: Lad, Prabhakar Date: Sat, 7 Mar 2015 15:30:50 +0000 (-0300) Subject: [media] media: am437x-vpfe: return error in case memory allocation failure X-Git-Tag: firefly_0821_release~176^2~795^2~1240 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7d87db3df00ccc138d6243ec12eb354e9c3f48ec;p=firefly-linux-kernel-4.4.55.git [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 --- 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);