Skip to content

Commit

Permalink
net: ethernet: adi: Fix invalid parent name length
Browse files Browse the repository at this point in the history
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: bc93e19 ("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>
  • Loading branch information
Alexandru Tachici authored and Jakub Kicinski committed Sep 22, 2022
1 parent 377c17c commit 2b99774
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/adi/adin1110.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2b99774

Please sign in to comment.