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)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 10 Nov 2022 10:03:00 +0000 (11:03 +0100)
commit7f94d0498f9c763f37172c08059ae91804c3075a
tree00fea0f4895092baef307209f38b460f7f3b7802
parentfe5b3ce8b4377e543960220f539b989a927afd8a
stmmac: dwmac-loongson: fix missing of_node_put() while module exiting

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>
drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c