Skip to contentSkip to conversation

phy: mdiobus_register(): initialize all phy_map entries

PATCH New Herbert Valerio Riedel 1 participant 1 message May 10, 2006

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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

---

 drivers/net/phy/mdio_bus.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/net/phy/mdio_bus.c +3 -1
Index: b/drivers/net/phy/mdio_bus.c
===================================================================
@@ -60,8 +60,10 @@
 	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);