diff options
author | Michael Grzeschik <m.grzeschik@pengutronix.de> | 2017-11-08 09:56:35 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-11-11 15:27:44 +0900 |
commit | 66ee6a06e620740b706b8dbde161492f6a405b26 (patch) | |
tree | c1a111dfd98801469ff4bc7ce75b1bc96fa178b3 /drivers | |
parent | 9ce981401cce7852542cab267702b6e89f37a4b8 (diff) |
net: macb: add of_node_put to error paths
We add the call of_node_put(bp->phy_node) to all associated error
paths for memory clean up.
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/cadence/macb_main.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index cc3f36a5c6e1..72a67f74b97b 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -611,6 +611,7 @@ static int macb_mii_init(struct macb *bp) err_out_unregister_bus: mdiobus_unregister(bp->mii_bus); err_out_free_mdiobus: + of_node_put(bp->phy_node); if (np && of_phy_is_fixed_link(np)) of_phy_deregister_fixed_link(np); mdiobus_free(bp->mii_bus); @@ -3552,6 +3553,7 @@ static int macb_probe(struct platform_device *pdev) err_out_unregister_mdio: phy_disconnect(dev->phydev); mdiobus_unregister(bp->mii_bus); + of_node_put(bp->phy_node); if (np && of_phy_is_fixed_link(np)) of_phy_deregister_fixed_link(np); mdiobus_free(bp->mii_bus); |