drivers/net/ethernet/ti: Move call to PTR_ERR after reassignment
authorJulia Lawall <Julia.Lawall@lip6.fr>
Thu, 2 Feb 2012 04:53:01 +0000 (04:53 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 2 Feb 2012 19:35:12 +0000 (14:35 -0500)
commitcb0a178c787d2bdf787d56e364becdb0eb4b4fab
tree607de6b3e6df8bac829256aa8790eaf04a8b2cb8
parent4b8a8bc9249f144803d840f2f7608ee9bbf1ea51
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>
drivers/net/ethernet/ti/davinci_emac.c
drivers/net/ethernet/ti/davinci_mdio.c