of/address: Don't loop forever in of_find_matching_node_by_address().
authorDavid Daney <david.daney@cavium.com>
Wed, 19 Aug 2015 20:17:47 +0000 (13:17 -0700)
committerSasha Levin <sasha.levin@oracle.com>
Wed, 28 Oct 2015 02:14:51 +0000 (22:14 -0400)
commitbe2a16239713fcaa5c0479c5cb0821cdba59fc81
tree5d0dc1c52b81e032daa0877b9e38511559d40aaa
parent825cc9616f9b826bb700973b58ae7affa3da5748
of/address: Don't loop forever in of_find_matching_node_by_address().

[ Upstream commit 3a496b00b6f90c41bd21a410871dfc97d4f3c7ab ]

If the internal call to of_address_to_resource() fails, we end up
looping forever in of_find_matching_node_by_address().  This can be
caused by a defective device tree, or calling with an incorrect
matches argument.

Fix by calling of_find_matching_node() unconditionally at the end of
the loop.

Signed-off-by: David Daney <david.daney@cavium.com>
Cc: stable@vger.kernel.org
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
drivers/of/address.c