]> git.baikalelectronics.ru Git - kernel.git/commit
of: fix reference counting in of_graph_get_endpoint_by_regs
authorLucas Stach <l.stach@pengutronix.de>
Mon, 15 Aug 2016 12:58:43 +0000 (14:58 +0200)
committerRob Herring <robh@kernel.org>
Mon, 15 Aug 2016 16:15:05 +0000 (11:15 -0500)
commit9f9e3e9a81e4f33eb2f2f04b52505c9f37aea5d7
tree915da4e3ee4627a14ea40e065e2458edf87b20c7
parentcc007a594cfc437fa8bfb227abb9fa119eb9e4e0
of: fix reference counting in of_graph_get_endpoint_by_regs

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.

Use the for_each_endpoint_of_node() helper to interate through the
endpoint OF nodes, which already does the right thing and simplifies
the code a bit.

Fixes: 2d1919d9c296
(of: add helper for getting endpoint node of specific identifiers)
Cc: stable@vger.kernel.org
Reported-by: David Jander <david@protonic.nl>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Rob Herring <robh@kernel.org>
drivers/of/base.c