Commit 2b997747 authored by Alexandru Tachici's avatar Alexandru Tachici Committed by Jakub Kicinski

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: bc93e19d ("net: ethernet: adi: Add ADIN1110 support")
Signed-off-by: default avatarAlexandru Tachici <alexandru.tachici@analog.com>
Link: https://lore.kernel.org/r/20220922063049.10388-1-alexandru.tachici@analog.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 377c17c6
...@@ -1028,7 +1028,7 @@ static int adin1110_port_get_port_parent_id(struct net_device *dev, ...@@ -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_port_priv *port_priv = netdev_priv(dev);
struct adin1110_priv *priv = port_priv->priv; 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); memcpy(ppid->id, priv->mii_bus_name, ppid->id_len);
return 0; return 0;
......
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