summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/am437x
diff options
context:
space:
mode:
authorLaurent Pinchart2015-02-23 15:49:21 +0100
committerMauro Carvalho Chehab2015-04-02 23:10:06 +0200
commitee662d44a23df45e2b3ff8b122e165b57672b656 (patch)
tree23d26f7f0e692aa28b42170fc63bbeec0959fa98 /drivers/media/platform/am437x
parent[media] uvcvideo: Validate index during step-wise frame intervals enumeration (diff)
downloadkernel-qcow2-linux-ee662d44a23df45e2b3ff8b122e165b57672b656.tar.gz
kernel-qcow2-linux-ee662d44a23df45e2b3ff8b122e165b57672b656.tar.xz
kernel-qcow2-linux-ee662d44a23df45e2b3ff8b122e165b57672b656.zip
[media] media: am437x: Don't release OF node reference twice
The remote port reference is released both at the end of the OF graph parsing loop, and in the error code path at the end of the function. Those two calls will release the same reference, causing the reference count to go negative. Fix the problem by removing the second call. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Acked-by: Benoit Parrot <bparrot@ti.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.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/media/platform/am437x/am437x-vpfe.c b/drivers/media/platform/am437x/am437x-vpfe.c
index 73fdb0d6b092..8daa93047b4f 100644
--- a/drivers/media/platform/am437x/am437x-vpfe.c
+++ b/drivers/media/platform/am437x/am437x-vpfe.c
@@ -2427,7 +2427,7 @@ static int vpfe_async_complete(struct v4l2_async_notifier *notifier)
static struct vpfe_config *
vpfe_get_pdata(struct platform_device *pdev)
{
- struct device_node *endpoint = NULL, *rem = NULL;
+ struct device_node *endpoint = NULL;
struct v4l2_of_endpoint bus_cfg;
struct vpfe_subdev_info *sdinfo;
struct vpfe_config *pdata;
@@ -2445,6 +2445,8 @@ vpfe_get_pdata(struct platform_device *pdev)
return NULL;
for (i = 0; ; i++) {
+ struct device_node *rem;
+
endpoint = of_graph_get_next_endpoint(pdev->dev.of_node,
endpoint);
if (!endpoint)
@@ -2515,7 +2517,6 @@ vpfe_get_pdata(struct platform_device *pdev)
done:
of_node_put(endpoint);
- of_node_put(rem);
return NULL;
}