From: Niklas Söderlund Date: Tue, 22 Aug 2017 00:19:12 +0000 (+0200) Subject: device property: preserve usecount for node passed to of_fwnode_graph_get_port_parent() X-Git-Tag: v4.14-rc5~16^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3314c6bdd26880e0dfbcb0cb85a1b36d185ce47c;p=platform%2Fkernel%2Flinux-rpi.git device property: preserve usecount for node passed to of_fwnode_graph_get_port_parent() Using CONFIG_OF_DYNAMIC=y uncovered an imbalance in the usecount of the node being passed to of_fwnode_graph_get_port_parent(). Preserve the usecount by using of_get_parent() instead of of_get_next_parent() which don't decrement the usecount of the node passed to it. Fixes: 3b27d00e7b6d7c88 ("device property: Move fwnode graph ops to firmware specific locations") Signed-off-by: Niklas Söderlund Acked-by: Sakari Ailus Signed-off-by: Rob Herring --- diff --git a/drivers/of/property.c b/drivers/of/property.c index fbb7211..264c355 100644 --- a/drivers/of/property.c +++ b/drivers/of/property.c @@ -954,7 +954,7 @@ of_fwnode_graph_get_port_parent(struct fwnode_handle *fwnode) struct device_node *np; /* Get the parent of the port */ - np = of_get_next_parent(to_of_node(fwnode)); + np = of_get_parent(to_of_node(fwnode)); if (!np) return NULL;