Skip to content

Commit

Permalink
phy: mdiobus_register(): initialize all phy_map entries
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Herbert Valerio Riedel authored and Stephen Hemminger committed May 10, 2006
1 parent f4ea431 commit 64b1c2b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/net/phy/mdio_bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 64b1c2b

Please sign in to comment.