net: ethernet: bgmac: Fix refcount leak in bcma_mdio_mii_register
Subsystems (3)
PATCH 1/1 net: ethernet: bgmac: Fix refcount leak in bcma_mdio_mii_register
of_get_child_by_name() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. Add missing of_node_put() to avoid refcount leak.
Fixes: format:55954f3bfdac ("net: ethernet: bgmac: move BCMA MDIO Phy code into a separate file")
Signed-off-by Miaoqian Lin <[email protected]>
--- drivers/net/ethernet/broadcom/bgmac-bcma-mdio.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/broadcom/bgmac-bcma-mdio.c +1 -0
@@ -234,6 +234,7 @@ struct mii_bus *bcma_mdio_mii_register(struct bgmac *bgmac) np =of_get_child_by_name (core->dev.of_node,"mdio" ); err =of_mdiobus_register (mii_bus, np); +of_node_put (np);if (err) {dev_err (&core->dev,"Registration of mii bus failed\n" ); goto err_free_bus;
Signature · 1 line
2.25.1