]> 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)
committerDavid S. Miller <davem@davemloft.net>
Fri, 27 May 2022 07:02:33 +0000 (08:02 +0100)
commitf9ecb3fd134743f249d9155c7a9eb61f444cf295
treef607ccaf0462b0e3c53fb8212bf31be3d6706aa3
parenteb1324f1fa3f369ec87b1c34107a0f1370c39c44
net: dsa: mv88e6xxx: Fix refcount leak in mv88e6xxx_mdios_register

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: b34277b7205d ("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>
drivers/net/dsa/mv88e6xxx/chip.c