summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/adi
diff options
context:
space:
mode:
authorAlexandru Tachici <alexandru.andrei.tachici@gmail.com>2022-09-22 09:30:49 +0300
committerJakub Kicinski <kuba@kernel.org>2022-09-22 17:22:11 +0300
commit2b9977470b39e011ee5fbc01ca55411a7768fb9d (patch)
tree9a08d178fb9fbb5aa1dc8b659116b705851a467d /drivers/net/ethernet/adi
parent377c17c6757ccf43e97f681a6ac5163d3735ab0a (diff)
downloadlinux-2b9977470b39e011ee5fbc01ca55411a7768fb9d.tar.xz
net: ethernet: adi: Fix invalid parent name length
MII_BUS_ID_SIZE is larger than MAX_PHYS_ITEM_ID_LEN so we use the former here to set the parent port id. Fixes: bc93e19d088b ("net: ethernet: adi: Add ADIN1110 support") Signed-off-by: Alexandru Tachici <alexandru.tachici@analog.com> Link: https://lore.kernel.org/r/20220922063049.10388-1-alexandru.tachici@analog.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/adi')
-rw-r--r--drivers/net/ethernet/adi/adin1110.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/adi/adin1110.c b/drivers/net/ethernet/adi/adin1110.c
index 4dacb98e7e0a..4f3c372292f3 100644
--- a/drivers/net/ethernet/adi/adin1110.c
+++ b/drivers/net/ethernet/adi/adin1110.c
@@ -1028,7 +1028,7 @@ static int adin1110_port_get_port_parent_id(struct net_device *dev,
struct adin1110_port_priv *port_priv = netdev_priv(dev);
struct adin1110_priv *priv = port_priv->priv;
- ppid->id_len = strnlen(priv->mii_bus_name, MII_BUS_ID_SIZE);
+ ppid->id_len = strnlen(priv->mii_bus_name, MAX_PHYS_ITEM_ID_LEN);
memcpy(ppid->id, priv->mii_bus_name, ppid->id_len);
return 0;