Skip to content

Commit

Permalink
net: ucc_geth: make probe consistently acquire a reference to the phy…
Browse files Browse the repository at this point in the history
… node

When the driver attaches to a device that has a phy handle the probe
routine returns with a reference to that node. This reference is
correctly dropped in the error path and the remove function. In the
fixed phy case however no reference is acquired and so the error path
might drop a reference the driver isn't holding. Fix that by getting a
reference to the MAC.

Fixes: 8700981 ("ucc_geth: 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 fa31078 commit f1f02fa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/freescale/ucc_geth.c
Original file line number Diff line number Diff line change
Expand Up @@ -3794,7 +3794,7 @@ static int ucc_geth_probe(struct platform_device* ofdev)
if (err)
return err;
}
ug_info->phy_node = np;
ug_info->phy_node = of_node_get(np);
}

/* Find the TBI PHY node. If it's not there, we don't support SGMII */
Expand Down

0 comments on commit f1f02fa

Please sign in to comment.