mirror of
https://github.com/torvalds/linux.git
synced 2024-11-27 22:51:35 +00:00
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 <hvr@gnu.org> Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
This commit is contained in:
parent
f4ea431bb7
commit
64b1c2b42b
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user