DORMANTno replies

[PATCH] of: fix reference counting in of_graph_get_endpoint_by_regs

From: Lucas Stach <hidden>
Date: 2016-06-17 10:05:29
Subsystem: open firmware and flattened device tree, the rest · Maintainers: Rob Herring, Saravana Kannan, Linus Torvalds

The called of_graph_get_next_endpoint() already decrements the refcount
of the prev node, so it is wrong to do it again in the calling function.

Fixes: 8ccd0d0ca041
(of: add helper for getting endpoint node of specific identifiers)
Cc: stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Reported-by: David Jander <david-/Q/L1SwJa3aEVqv0pETR8A@public.gmane.org>
Signed-off-by: Lucas Stach <redacted>
---
 drivers/of/base.c | 1 -
 1 file changed, 1 deletion(-)
diff --git a/drivers/of/base.c b/drivers/of/base.c
index ebf84e3b56d5..6d8514c431f5 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -2310,7 +2310,6 @@ struct device_node *of_graph_get_endpoint_by_regs(
 
 	while (1) {
 		node = of_graph_get_next_endpoint(parent, prev_node);
-		of_node_put(prev_node);
 		if (!node)
 			break;
 
-- 
2.8.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help