Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 46997066 authored by Peter Chen's avatar Peter Chen Committed by David S. Miller
Browse files

ethernet: cavium: octeon: add missing of_node_put after calling of_parse_phandle



of_node_put needs to be called when the device node which is got
from of_parse_phandle has finished using.

Signed-off-by: default avatarPeter Chen <peter.chen@nxp.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8d00201a
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1513,6 +1513,7 @@ static int octeon_mgmt_probe(struct platform_device *pdev)
	return 0;

err:
	of_node_put(p->phy_np);
	free_netdev(netdev);
	return result;
}
@@ -1520,8 +1521,10 @@ static int octeon_mgmt_probe(struct platform_device *pdev)
static int octeon_mgmt_remove(struct platform_device *pdev)
{
	struct net_device *netdev = platform_get_drvdata(pdev);
	struct octeon_mgmt *p = netdev_priv(netdev);

	unregister_netdev(netdev);
	of_node_put(p->phy_np);
	free_netdev(netdev);
	return 0;
}