netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Richard Zhao <richard.zhao@linaro.org>
To: <netdev@vger.kernel.org>
Cc: <davem@davemloft.net>, <shawn.guo@linaro.org>,
	<u.kleine-koenig@pengutronix.de>, <LW@KARO-electronics.de>,
	<linux-arm-kernel@lists.infradead.org>, <patches@linaro.org>,
	Richard Zhao <richard.zhao@linaro.org>
Subject: [PATCH 1/1] net: fec: correct phy_name buffer length when init phy_name
Date: Mon, 30 Jan 2012 16:08:12 +0800	[thread overview]
Message-ID: <1327910892-11251-1-git-send-email-richard.zhao@linaro.org> (raw)

Fix the bug that we got wrong phy_name on imx6q sabrelite board.
snprintf used wrong length of phy_name.
phy_name length is MII_BUS_ID_SIZE + 3 rather not MII_BUS_ID_SIZE.
I change it to sizeof(phy_name).

Signed-off-by: Richard Zhao <richard.zhao@linaro.org>
---
 drivers/net/ethernet/freescale/fec.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c
index 7b25e9c..1c7aad8 100644
--- a/drivers/net/ethernet/freescale/fec.c
+++ b/drivers/net/ethernet/freescale/fec.c
@@ -990,7 +990,7 @@ static int fec_enet_mii_probe(struct net_device *ndev)
 		phy_id = 0;
 	}
 
-	snprintf(phy_name, MII_BUS_ID_SIZE, PHY_ID_FMT, mdio_bus_id, phy_id);
+	snprintf(phy_name, sizeof(phy_name), PHY_ID_FMT, mdio_bus_id, phy_id);
 	phy_dev = phy_connect(ndev, phy_name, &fec_enet_adjust_link, 0,
 			      fep->phy_interface);
 	if (IS_ERR(phy_dev)) {
-- 
1.7.5.4

             reply	other threads:[~2012-01-30  8:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-30  8:08 Richard Zhao [this message]
2012-01-30  9:51 ` [PATCH 1/1] net: fec: correct phy_name buffer length when init phy_name Shawn Guo
2012-01-30 11:07   ` Florian Fainelli
2012-01-31 21:18 ` David Miller

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=1327910892-11251-1-git-send-email-richard.zhao@linaro.org \
    --to=richard.zhao@linaro.org \
    --cc=LW@KARO-electronics.de \
    --cc=davem@davemloft.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=netdev@vger.kernel.org \
    --cc=patches@linaro.org \
    --cc=shawn.guo@linaro.org \
    --cc=u.kleine-koenig@pengutronix.de \
    /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;
as well as URLs for NNTP newsgroup(s).