Skip to content
Commit 0549bde0 authored by Qi Hou's avatar Qi Hou Committed by Rob Herring
Browse files

of: fix of_node leak caused in of_find_node_opts_by_path



During stepping down the tree, parent node is gotten first and its refcount is
increased with of_node_get() in __of_get_next_child(). Since it just being used
as tmp node, its refcount must be decreased with of_node_put() after traversing
its child nodes.

Or, its refcount will never be descreased to ZERO, then it will never be freed,
as well as other related memory blocks.

To fix this, decrease refcount of parent with of_node_put() after
__of_find_node_by_path().

Signed-off-by: default avatarQi Hou <qi.hou@windriver.com>
Acked-by: default avatarPeter Rosin <peda@axentia.se>
Signed-off-by: default avatarRob Herring <robh@kernel.org>
parent 4b741bc3
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment