linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc: pseries: Fix refcount bug in ibmebus
@ 2022-06-19  7:40 Liang He
  2022-09-09 12:07 ` Michael Ellerman
  0 siblings, 1 reply; 2+ messages in thread
From: Liang He @ 2022-06-19  7:40 UTC (permalink / raw)
  To: mpe, benh, paulus, dan.j.williams, t.scherer, vilhelm.gray, rafael
  Cc: linuxppc-dev, windhl

In ibmebus_match_path(), we should use of_node_put() to keep
refcount balance.

Signed-off-by: Liang He <windhl@126.com>
---
 arch/powerpc/platforms/pseries/ibmebus.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/pseries/ibmebus.c b/arch/powerpc/platforms/pseries/ibmebus.c
index 7ee3ed7d6cc2..a870cada7acd 100644
--- a/arch/powerpc/platforms/pseries/ibmebus.c
+++ b/arch/powerpc/platforms/pseries/ibmebus.c
@@ -152,7 +152,11 @@ static const struct dma_map_ops ibmebus_dma_ops = {
 static int ibmebus_match_path(struct device *dev, const void *data)
 {
 	struct device_node *dn = to_platform_device(dev)->dev.of_node;
-	return (of_find_node_by_path(data) == dn);
+	struct device_node *tn = of_find_node_by_path(data);
+
+	of_node_put(tn);
+
+	return (tn == dn);
 }
 
 static int ibmebus_match_node(struct device *dev, const void *data)
-- 
2.25.1


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

end of thread, other threads:[~2022-09-09 12:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-19  7:40 [PATCH] powerpc: pseries: Fix refcount bug in ibmebus Liang He
2022-09-09 12:07 ` Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).