Re: [PATCH v2 resend 2/8] hwtracing: use for_each_endpoint_of_node()
From: James Clark <hidden>
Date: 2024-05-29 12:30:16
Also in:
dri-devel, linux-fbdev, linux-media, linux-staging
On 29/05/2024 01:40, Laurent Pinchart wrote:
Hi Morimoto-san, Thank you for the patch. On Tue, May 28, 2024 at 11:55:32PM +0000, Kuninori Morimoto wrote:quoted
We already have for_each_endpoint_of_node(), don't use of_graph_get_next_endpoint() directly. Replace it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com> --- drivers/hwtracing/coresight/coresight-platform.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)diff --git a/drivers/hwtracing/coresight/coresight-platform.c b/drivers/hwtracing/coresight/coresight-platform.c index 9d550f5697fa8..e9683e613d520 100644 --- a/drivers/hwtracing/coresight/coresight-platform.c +++ b/drivers/hwtracing/coresight/coresight-platform.c@@ -275,7 +275,7 @@ static int of_get_coresight_platform_data(struct device *dev, */ if (!parent) { /* - * Avoid warnings in of_graph_get_next_endpoint() + * Avoid warnings in for_each_endpoint_of_node() * if the device doesn't have any graph connections */ if (!of_graph_is_present(node))@@ -286,7 +286,7 @@ static int of_get_coresight_platform_data(struct device *dev, } /* Iterate through each output port to discover topology */ - while ((ep = of_graph_get_next_endpoint(parent, ep))) { + for_each_endpoint_of_node(parent, ep) { /* * Legacy binding mixes input/output ports under the * same parent. So, skip the input ports if we are dealingI think there's a bug below. The loop contains ret = of_coresight_parse_endpoint(dev, ep, pdata); if (ret) return ret; which leaks the reference to ep. This is not introduced by this patch, so
Nice catch, I will send a patch. Also: Reviewed-by: James Clark <redacted>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
_______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel