diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2009-12-11 19:32:58 +0000 |
---|---|---|
committer | Gabor Juhos <juhosg@openwrt.org> | 2009-12-11 19:32:58 +0000 |
commit | 8956009fa698e6ddf678d68cb32db4a76acfb632 (patch) | |
tree | 223d207b93725c042b963cbda832bc615a2b6d6c /target | |
parent | 95fa0702028d0aa0ffb625e5fd08e90d76d4290f (diff) | |
download | mtk-20170518-8956009fa698e6ddf678d68cb32db4a76acfb632.zip mtk-20170518-8956009fa698e6ddf678d68cb32db4a76acfb632.tar.gz mtk-20170518-8956009fa698e6ddf678d68cb32db4a76acfb632.tar.bz2 |
ar71xx: fix NULL pointer dereference in the ethernet driver
SVN-Revision: 18755
Diffstat (limited to 'target')
-rw-r--r-- | target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_phy.c | 8 |
1 files changed, 5 insertions, 3 deletions
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 547f72e..4233152 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); |