Commit 64b1c2b4 authored by Herbert Valerio Riedel's avatar Herbert Valerio Riedel Committed by Stephen Hemminger

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: default avatarHerbert Valerio Riedel <hvr@gnu.org>
Signed-off-by: default avatarStephen Hemminger <shemminger@osdl.org>
parent f4ea431b
...@@ -60,8 +60,10 @@ int mdiobus_register(struct mii_bus *bus) ...@@ -60,8 +60,10 @@ int mdiobus_register(struct mii_bus *bus)
for (i = 0; i < PHY_MAX_ADDR; i++) { for (i = 0; i < PHY_MAX_ADDR; i++) {
struct phy_device *phydev; struct phy_device *phydev;
if (bus->phy_mask & (1 << i)) if (bus->phy_mask & (1 << i)) {
bus->phy_map[i] = NULL;
continue; continue;
}
phydev = get_phy_device(bus, i); phydev = get_phy_device(bus, i);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment