ar71xx: fix NULL pointer dereference in the ethernet driver

SVN-Revision: 18755
owl
Gabor Juhos 2009-12-11 19:32:58 +00:00
parent 95fa070202
commit 8956009fa6
1 changed files with 5 additions and 3 deletions

View File

@ -309,9 +309,11 @@ int ag71xx_phy_connect(struct ag71xx *ag)
}
/* Reset the mdio bus explicitly */
mutex_lock(&ag->mii_bus->mdio_lock);
ag->mii_bus->reset(ag->mii_bus);
mutex_unlock(&ag->mii_bus->mdio_lock);
if (ag->mii_bus->reset) {
mutex_lock(&ag->mii_bus->mdio_lock);
ag->mii_bus->reset(ag->mii_bus);
mutex_unlock(&ag->mii_bus->mdio_lock);
}
if (pdata->phy_mask)
return ag71xx_phy_connect_multi(ag);