kernel/drivers/net/phy/mdio_bus.c
.. .. @@ -108,7 +108,12 @@ 108 108 109 109 struct phy_device *mdiobus_get_phy(struct mii_bus *bus, int addr) 110 110 { 111 - struct mdio_device *mdiodev = bus->mdio_map[addr];111 + struct mdio_device *mdiodev;112 +113 + if (addr < 0 || addr >= ARRAY_SIZE(bus->mdio_map))114 + return NULL;115 +116 + mdiodev = bus->mdio_map[addr];112 117 113 118 if (!mdiodev) 114 119 return NULL;