[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220601042514.61780-1-linmq006@gmail.com>
Date: Wed, 1 Jun 2022 08:25:14 +0400
From: Miaoqian Lin <linmq006@...il.com>
To: Hyun Kwon <hyun.kwon@...inx.com>,
Laurent Pinchart <laurent.pinchart@...asonboard.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Michal Simek <michal.simek@...inx.com>,
Radhey Shyam Pandey <radheys@...inx.com>,
Hans Verkuil <hans.verkuil@...co.com>,
linux-media@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org
Cc: linmq006@...il.com
Subject: [PATCH] v4l: xilinx-vipp: Fix refcount leak in xvip_graph_dma_init
of_get_child_by_name() returns a node pointer with refcount
incremented, we should use of_node_put() on it when not need anymore.
Add missing of_node_put() to avoid refcount leak.
Fixes: df3305156f98 ("[media] v4l: xilinx: Add Xilinx Video IP core")
Signed-off-by: Miaoqian Lin <linmq006@...il.com>
---
drivers/media/platform/xilinx/xilinx-vipp.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/media/platform/xilinx/xilinx-vipp.c b/drivers/media/platform/xilinx/xilinx-vipp.c
index f34f8b077e03..415579b63737 100644
--- a/drivers/media/platform/xilinx/xilinx-vipp.c
+++ b/drivers/media/platform/xilinx/xilinx-vipp.c
@@ -483,10 +483,12 @@ static int xvip_graph_dma_init(struct xvip_composite_device *xdev)
ret = xvip_graph_dma_init_one(xdev, port);
if (ret < 0) {
of_node_put(port);
+ of_node_put(ports);
return ret;
}
}
+ of_node_put(ports);
return 0;
}
--
2.25.1
Powered by blists - more mailing lists