From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Li Yang <leoli@freescale.com>
Cc: netdev@vger.kernel.org, Florian Fainelli <f.fainelli@gmail.com>,
linuxppc-dev@lists.ozlabs.org, kernel@pengutronix.de
Subject: [PATCH 2/3] net: ucc_geth: make probe consistently acquire a reference to the phy node
Date: Thu, 7 Aug 2014 23:48:25 +0200 [thread overview]
Message-ID: <1407448106-1819-2-git-send-email-u.kleine-koenig@pengutronix.de> (raw)
In-Reply-To: <1407448106-1819-1-git-send-email-u.kleine-koenig@pengutronix.de>
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>
---
drivers/net/ethernet/freescale/ucc_geth.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c
index 5f1aab9c4ee7..a22ff770f9e5 100644
--- a/drivers/net/ethernet/freescale/ucc_geth.c
+++ b/drivers/net/ethernet/freescale/ucc_geth.c
@@ -3796,7 +3796,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 */
--
2.0.1
next prev parent reply other threads:[~2014-08-07 21:48 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-07 21:48 [PATCH 1/3] net: ucc_geth: drop acquired references in probe error path and remove Uwe Kleine-König
2014-08-07 21:48 ` Uwe Kleine-König [this message]
2014-08-07 23:07 ` [PATCH 2/3] net: ucc_geth: make probe consistently acquire a reference to the phy node David Miller
2014-08-07 21:48 ` [PATCH 3/3] net: ucc_geth: Don't use the MAC as PHY without a fixed link Uwe Kleine-König
2014-08-07 23:07 ` David Miller
2014-08-07 23:07 ` [PATCH 1/3] net: ucc_geth: drop acquired references in probe error path and remove David Miller
2014-08-08 20:34 ` Uwe Kleine-König
2014-08-08 20:52 ` David Miller
2014-08-10 18:32 ` [PATCH] net: ucc_geth: fix build failure Uwe Kleine-König
2014-08-11 4:40 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1407448106-1819-2-git-send-email-u.kleine-koenig@pengutronix.de \
--to=u.kleine-koenig@pengutronix.de \
--cc=f.fainelli@gmail.com \
--cc=kernel@pengutronix.de \
--cc=leoli@freescale.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).