summaryrefslogtreecommitdiffstats
path: root/drivers/net/phy/mdio_bus.c
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2023-01-20 21:28:23 +0100
committerJakub Kicinski <kuba@kernel.org>2023-01-20 21:28:23 +0100
commitb3c588cd553d6996cc97f3dc0a7081b9a9b36b48 (patch)
tree37e51018ad3f74bf91a7b4a54a0893d048440bd1 /drivers/net/phy/mdio_bus.c
parentMerge branch 'octeontx2-af-miscellaneous-changes-for-cpt' (diff)
parentMerge tag 'net-6.2-rc5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ne... (diff)
downloadlinux-b3c588cd553d6996cc97f3dc0a7081b9a9b36b48.tar.xz
linux-b3c588cd553d6996cc97f3dc0a7081b9a9b36b48.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
drivers/net/ipa/ipa_interrupt.c drivers/net/ipa/ipa_interrupt.h 9ec9b2a30853 ("net: ipa: disable ipa interrupt during suspend") 8e461e1f092b ("net: ipa: introduce ipa_interrupt_enable()") d50ed3558719 ("net: ipa: enable IPA interrupt handlers separate from registration") https://lore.kernel.org/all/20230119114125.5182c7ab@canb.auug.org.au/ https://lore.kernel.org/all/79e46152-8043-a512-79d9-c3b905462774@tessares.net/ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/phy/mdio_bus.c')
-rw-r--r--drivers/net/phy/mdio_bus.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
index 5b2f48c09a6a..fb633fa3e872 100644
--- a/drivers/net/phy/mdio_bus.c
+++ b/drivers/net/phy/mdio_bus.c
@@ -109,7 +109,12 @@ EXPORT_SYMBOL(mdiobus_unregister_device);
struct phy_device *mdiobus_get_phy(struct mii_bus *bus, int addr)
{
- struct mdio_device *mdiodev = bus->mdio_map[addr];
+ struct mdio_device *mdiodev;
+
+ if (addr < 0 || addr >= ARRAY_SIZE(bus->mdio_map))
+ return NULL;
+
+ mdiodev = bus->mdio_map[addr];
if (!mdiodev)
return NULL;