diff options
author | Uwe Kleine-König | 2014-08-07 23:48:25 +0200 |
---|---|---|
committer | David S. Miller | 2014-08-08 01:02:59 +0200 |
commit | f1f02fa4f15bc682814c71fe05c6b76e5f5fba80 (patch) | |
tree | 52c27a3d39fbc50b08f94d9c2c420042b89ba657 /drivers/net/ethernet/freescale/ucc_geth.c | |
parent | net: ucc_geth: drop acquired references in probe error path and remove (diff) | |
download | kernel-qcow2-linux-f1f02fa4f15bc682814c71fe05c6b76e5f5fba80.tar.gz kernel-qcow2-linux-f1f02fa4f15bc682814c71fe05c6b76e5f5fba80.tar.xz kernel-qcow2-linux-f1f02fa4f15bc682814c71fe05c6b76e5f5fba80.zip |
net: ucc_geth: make probe consistently acquire a reference to the phy 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: 87009814cdbb ("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>
Diffstat (limited to 'drivers/net/ethernet/freescale/ucc_geth.c')
-rw-r--r-- | drivers/net/ethernet/freescale/ucc_geth.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c index f6b956952269..0c83ef078ddf 100644 --- a/drivers/net/ethernet/freescale/ucc_geth.c +++ b/drivers/net/ethernet/freescale/ucc_geth.c @@ -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 */ |