Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <niklas.soderlund+renesas@ragnatech.se>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Rob Herring <robh@kernel.org>

authored by

Niklas Söderlund and committed by
Rob Herring
3314c6bd 22f8cc6e

+1 -1
+1 -1
drivers/of/property.c
··· 954 954 struct device_node *np; 955 955 956 956 /* Get the parent of the port */ 957 - np = of_get_next_parent(to_of_node(fwnode)); 957 + np = of_get_parent(to_of_node(fwnode)); 958 958 if (!np) 959 959 return NULL; 960 960