summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/am437x
diff options
context:
space:
mode:
authorLad, Prabhakar <prabhakar.csengg@gmail.com>2015-03-07 16:30:50 +0100
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-04-02 23:10:42 +0200
commit7d87db3df00ccc138d6243ec12eb354e9c3f48ec (patch)
treee3506005b9d4feaab5b0066175a7b94a8a1f2a0a /drivers/media/platform/am437x
parent[media] media: am437x-vpfe: match the OF node/i2c addr instead of name (diff)
downloadlinux-7d87db3df00ccc138d6243ec12eb354e9c3f48ec.tar.xz
linux-7d87db3df00ccc138d6243ec12eb354e9c3f48ec.zip
[media] media: am437x-vpfe: return error in case memory allocation failure
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>
Diffstat (limited to 'drivers/media/platform/am437x')
-rw-r--r--drivers/media/platform/am437x/am437x-vpfe.c6
1 files changed, 6 insertions, 0 deletions
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);