All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bus: ti-sysc: Add missing of_node_put() in sysc_add_named_clock_from_child()
@ 2022-06-20  9:31 Peng Wu
  2022-06-28  5:56 ` Tony Lindgren
  0 siblings, 1 reply; 2+ messages in thread
From: Peng Wu @ 2022-06-20  9:31 UTC (permalink / raw)
  To: tony; +Cc: linux-omap, linux-kernel, liwei391, wupeng58

of_get_next_available_child() 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.

Signed-off-by: Peng Wu <wupeng58@huawei.com>
Reported-by: Hulk Robot <hulkci@huawei.com>
---
 drivers/bus/ti-sysc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
index 9a7d12332fad..73fd42dd25b3 100644
--- a/drivers/bus/ti-sysc.c
+++ b/drivers/bus/ti-sysc.c
@@ -333,6 +333,7 @@ static int sysc_add_named_clock_from_child(struct sysc *ddata,
 		return -ENODEV;
 
 	clock = devm_get_clk_from_child(ddata->dev, child, name);
+	of_node_put(child);
 	if (IS_ERR(clock))
 		return PTR_ERR(clock);
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] bus: ti-sysc: Add missing of_node_put() in sysc_add_named_clock_from_child()
  2022-06-20  9:31 [PATCH] bus: ti-sysc: Add missing of_node_put() in sysc_add_named_clock_from_child() Peng Wu
@ 2022-06-28  5:56 ` Tony Lindgren
  0 siblings, 0 replies; 2+ messages in thread
From: Tony Lindgren @ 2022-06-28  5:56 UTC (permalink / raw)
  To: Peng Wu; +Cc: linux-omap, linux-kernel, liwei391

* Peng Wu <wupeng58@huawei.com> [220620 12:32]:
> of_get_next_available_child() 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.

Thanks applying into omap-for-v5.20/ti-sysc.

Tony

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-06-28  5:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-20  9:31 [PATCH] bus: ti-sysc: Add missing of_node_put() in sysc_add_named_clock_from_child() Peng Wu
2022-06-28  5:56 ` Tony Lindgren

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.