of: mdio: Add of_node_put() when breaking out of for_each_xx
authorLiang He <windhl@126.com>
Tue, 13 Sep 2022 12:56:59 +0000 (20:56 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Sep 2022 09:11:50 +0000 (11:11 +0200)
commitcbdab7d68f203c26e0fb81610df6561e52c19f11
tree09dd40d54709226169902520d886c11e19879f88
parentca86577c10bc9970586ca89981243c1905c436d3
of: mdio: Add of_node_put() when breaking out of for_each_xx

[ Upstream commit 1c48709e6d9d353acaaac1d8e33474756b121d78 ]

In of_mdiobus_register(), we should call of_node_put() for 'child'
escaped out of for_each_available_child_of_node().

Fixes: 66bdede495c7 ("of_mdio: Fix broken PHY IRQ in case of probe deferral")
Co-developed-by: Miaoqian Lin <linmq006@gmail.com>
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Signed-off-by: Liang He <windhl@126.com>
Link: https://lore.kernel.org/r/20220913125659.3331969-1-windhl@126.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/mdio/of_mdio.c