Skip to content

Commit

Permalink
net: fs_enet: fix reference counting for phy_node
Browse files Browse the repository at this point in the history
Make sure that fs_enet_probe is left with a reference to the phy node.
In the presence of a phy handle this is already the case as
of_parse_phandle returns a reference. In the fixed phy case a call to
of_node_get is necessary. Otherwise the error path and remove function
drop a reference the driver isn't holding.

Fixes: bb74d9a ("fs_enet: use the new fixed PHY helpers")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Uwe Kleine-König authored and David S. Miller committed Aug 7, 2014
1 parent 9518259 commit 129cc83
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1033,7 +1033,7 @@ static int fs_enet_probe(struct platform_device *ofdev)
/* In the case of a fixed PHY, the DT node associated
* to the PHY is the Ethernet MAC DT node.
*/
fpi->phy_node = ofdev->dev.of_node;
fpi->phy_node = of_node_get(ofdev->dev.of_node);
}

if (of_device_is_compatible(ofdev->dev.of_node, "fsl,mpc5125-fec")) {
Expand Down

0 comments on commit 129cc83

Please sign in to comment.