mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-09 06:43:09 +00:00
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>
This commit is contained in:
parent
9ce981401c
commit
66ee6a06e6
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user