]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[media] media: am437x-vpfe: return error in case memory allocation failure
authorLad, Prabhakar <prabhakar.csengg@gmail.com>
Sat, 7 Mar 2015 15:30:50 +0000 (12:30 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Thu, 2 Apr 2015 21:10:42 +0000 (18:10 -0300)
return error in case devm_kzalloc() fails.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/platform/am437x/am437x-vpfe.c

index 7ea08308f03d5c24829ceaf0b88d87fc3d188ba0..006e9e867239567a439e241194f790f015af647b 100644 (file)
@@ -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);