diff options
author | Lad, Prabhakar <prabhakar.csengg@gmail.com> | 2015-03-07 12:30:50 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-04-02 18:10:42 -0300 |
commit | 7d87db3df00ccc138d6243ec12eb354e9c3f48ec (patch) | |
tree | e3506005b9d4feaab5b0066175a7b94a8a1f2a0a /drivers/media/platform/am437x | |
parent | d37232390fd4d1f76061879390b0447287730e6b (diff) |
[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.c | 6 |
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); |