summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/ti/davinci_emac.c
diff options
context:
space:
mode:
authorJulia Lawall <Julia.Lawall@lip6.fr>2012-02-02 08:53:01 +0400
committerDavid S. Miller <davem@davemloft.net>2012-02-02 23:35:12 +0400
commitcb0a178c787d2bdf787d56e364becdb0eb4b4fab (patch)
tree607de6b3e6df8bac829256aa8790eaf04a8b2cb8 /drivers/net/ethernet/ti/davinci_emac.c
parent4b8a8bc9249f144803d840f2f7608ee9bbf1ea51 (diff)
downloadlinux-cb0a178c787d2bdf787d56e364becdb0eb4b4fab.tar.xz
drivers/net/ethernet/ti: Move call to PTR_ERR after reassignment
PTR_ERR should be called before its argument is cleared. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression e,e1; constant c; @@ *e = c ... when != e = e1 when != &e when != true IS_ERR(e) *PTR_ERR(e) // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Reported-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/ti/davinci_emac.c')
-rw-r--r--drivers/net/ethernet/ti/davinci_emac.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
index 794ac30a577b..4fa0bcb25dfc 100644
--- a/drivers/net/ethernet/ti/davinci_emac.c
+++ b/drivers/net/ethernet/ti/davinci_emac.c
@@ -1600,8 +1600,9 @@ static int emac_dev_open(struct net_device *ndev)
if (IS_ERR(priv->phydev)) {
dev_err(emac_dev, "could not connect to phy %s\n",
priv->phy_id);
+ ret = PTR_ERR(priv->phydev);
priv->phydev = NULL;
- return PTR_ERR(priv->phydev);
+ return ret;
}
priv->link = 0;