From: Gabor Juhos Date: Fri, 11 Dec 2009 19:32:58 +0000 (+0000) Subject: ar71xx: fix NULL pointer dereference in the ethernet driver X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=8956009fa698e6ddf678d68cb32db4a76acfb632;p=librecmc%2Flibrecmc.git ar71xx: fix NULL pointer dereference in the ethernet driver SVN-Revision: 18755 --- diff --git a/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_phy.c b/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_phy.c index 547f72edba..4233152aec 100644 --- a/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_phy.c +++ b/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_phy.c @@ -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);