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 | f4e935e035e343953959038446e47901428c05dd (patch) | |
tree | 82ccfbf44b23f68dfae5fa9c2949af834cf08fdf /target/linux/ar71xx/files | |
parent | af7712e5a7fc15fd592355cdaeef6190b109c0dc (diff) | |
download | upstream-f4e935e035e343953959038446e47901428c05dd.tar.gz upstream-f4e935e035e343953959038446e47901428c05dd.tar.bz2 upstream-f4e935e035e343953959038446e47901428c05dd.zip |
ar71xx: fix NULL pointer dereference in the ethernet driver
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@18755 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ar71xx/files')
-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 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); |