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>
This commit is contained in:
parent
4b8a8bc924
commit
cb0a178c78
2 changed files with 3 additions and 2 deletions
|
@ -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;
|
||||
|
|
|
@ -318,9 +318,9 @@ static int __devinit davinci_mdio_probe(struct platform_device *pdev)
|
|||
|
||||
data->clk = clk_get(dev, NULL);
|
||||
if (IS_ERR(data->clk)) {
|
||||
data->clk = NULL;
|
||||
dev_err(dev, "failed to get device clock\n");
|
||||
ret = PTR_ERR(data->clk);
|
||||
data->clk = NULL;
|
||||
goto bail_out;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue