public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexandru Tachici <alexandru.andrei.tachici@gmail.com>
To: unlisted-recipients:; (no To-header on input)
Subject: [net-next] net: ethernet: adi: Fix invalid parent name length
Date: Wed, 21 Sep 2022 10:16:26 +0300	[thread overview]
Message-ID: <632b010d.170a0220.78d62.3138@mx.google.com> (raw)

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>
---
 drivers/net/ethernet/adi/adin1110.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;
-- 
2.34.1


             reply	other threads:[~2022-09-21 12:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-21  7:16 Alexandru Tachici [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-09-22  6:30 [net-next] net: ethernet: adi: Fix invalid parent name length Alexandru Tachici
2022-09-22 15:50 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=632b010d.170a0220.78d62.3138@mx.google.com \
    --to=alexandru.andrei.tachici@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox