]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: mv88e6xxx: Fix refcount leak in mv88e6xxx_mdios_register
authorMiaoqian Lin <linmq006@gmail.com>
Thu, 26 May 2022 14:52:08 +0000 (18:52 +0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Jun 2022 16:36:10 +0000 (18:36 +0200)
commit38d01588e53df99ec1a374888c62285f7755fa2b
tree523d2def4481bafd5fae15e5935e270a7b1feafe
parent2fa047ab5e82b48a514679beb7dc85691dd2c800
net: dsa: mv88e6xxx: Fix refcount leak in mv88e6xxx_mdios_register

[ Upstream commit a4f05fa557123b356c4baccdf6d5c9a8ea3d96a7 ]

of_get_child_by_name() returns a node pointer with refcount
incremented, we should use of_node_put() on it when done.

mv88e6xxx_mdio_register() pass the device node to of_mdiobus_register().
We don't need the device node after it.

Add missing of_node_put() to avoid refcount leak.

Fixes: 3a17ca7229f7 ("net: dsa: mv88e6xxx: Support multiple MDIO busses")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Reviewed-by: Marek BehĂșn <kabel@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/dsa/mv88e6xxx/chip.c