phy: mdiobus_register(): initialize all phy_map entries
authorHerbert Valerio Riedel <hvr@gnu.org>
Wed, 10 May 2006 16:12:57 +0000 (12:12 -0400)
committerStephen Hemminger <shemminger@osdl.org>
Wed, 10 May 2006 21:03:57 +0000 (14:03 -0700)
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 <hvr@gnu.org>
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
drivers/net/phy/mdio_bus.c

index 459443b572cef542a6757c1f02443f6ee42cbe7f..1b236bdf6b928d0dafa81c64ddcd3ac679c32e6c 100644 (file)
@@ -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);