stmmac: dwmac-loongson: fix missing of_node_put() while module exiting
authorYang Yingliang <yangyingliang@huawei.com>
Tue, 8 Nov 2022 11:46:47 +0000 (19:46 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Nov 2022 08:58:22 +0000 (09:58 +0100)
commit60a0af8813fddf3f1315e3dd79254a9b1845a294
tree47445c59c6e1ee3f42a55140bd7a21c581006218
parentee4a9bd2c7f4230cd0fcce3825718218d69806c4
stmmac: dwmac-loongson: fix missing of_node_put() while module exiting

[ Upstream commit 7f94d0498f9c763f37172c08059ae91804c3075a ]

The node returned by of_get_child_by_name() with refcount decremented,
of_node_put() needs be called when finish using it. So add it in the
error path in loongson_dwmac_probe() and in loongson_dwmac_remove().

Fixes: 2ae34111fe4e ("stmmac: dwmac-loongson: fix invalid mdio_node")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c