Skip to contentSkip to conversation

powerpc: pseries: Fix refcount bug in ibmebus

PATCH Applied Liang He 2 participants 2 messages Jun 19, 2022 – Sep 9, 2022 PowerPC

lore
Share & tools
lore

Liang He

author
#0 lore raw

PATCH 1/1 powerpc: pseries: Fix refcount bug in ibmebus

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

---
 arch/powerpc/platforms/pseries/ibmebus.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
arch/powerpc/platforms/pseries/ibmebus.c +5 -1
index 7ee3ed7d6cc2..a870cada7acd 100644
@@ -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)
Signature · 1 line
2.25.1