Fix locking bug noted by Roel Kluin <12o3l@tiscali.nl>.
Cc: Jeff Garzik <jeff@garzik.org>
Cc: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: Mikael Starvik <starvik@axis.com>
Cc: Roel Kluin <12o3l@tiscali.nl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
static int
e100_probe_transceiver(struct net_device* dev)
{
+ int ret = 0;
+
#if !defined(CONFIG_ETRAX_NO_PHY)
unsigned int phyid_high;
unsigned int phyid_low;
np->mii_if.phy_id, MII_BMSR) != 0xffff)
break;
}
- if (np->mii_if.phy_id == 32)
- return -ENODEV;
+ if (np->mii_if.phy_id == 32) {
+ ret = -ENODEV;
+ goto out;
+ }
/* Get manufacturer */
phyid_high = e100_get_mdio_reg(dev, np->mii_if.phy_id, MII_PHYSID1);
break;
}
transceiver = ops;
-
+out:
spin_unlock(&np->transceiver_lock);
#endif
- return 0;
+ return ret;
}
static int