From: Herbert Valerio Riedel Date: Wed, 10 May 2006 16:12:57 +0000 (-0400) Subject: phy: mdiobus_register(): initialize all phy_map entries X-Git-Tag: v2.6.17-rc4~8^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=64b1c2b42b555ef38c475d104f2faf3f6f93690d;p=platform%2Fkernel%2Flinux-stable.git phy: mdiobus_register(): initialize all phy_map entries make sure phy_map entries whose PHY address is masked are initialized to NULL, given that other code (such as mdiobus_unregister for instance) assumes that non-NULL phy_map entries are allocated phy_devices Signed-off-by: Herbert Valerio Riedel Signed-off-by: Stephen Hemminger --- diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c index 459443b..1b236bd 100644 --- a/drivers/net/phy/mdio_bus.c +++ b/drivers/net/phy/mdio_bus.c @@ -60,8 +60,10 @@ int mdiobus_register(struct mii_bus *bus) for (i = 0; i < PHY_MAX_ADDR; i++) { struct phy_device *phydev; - if (bus->phy_mask & (1 << i)) + if (bus->phy_mask & (1 << i)) { + bus->phy_map[i] = NULL; continue; + } phydev = get_phy_device(bus, i);