diff options
author | Richard Zhao <richard.zhao@linaro.org> | 2012-01-30 02:08:12 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-02-01 01:17:25 +0400 |
commit | a7ed07d51c8abdb407be454c6cb6cfad613759d9 (patch) | |
tree | 30b7ce649d8b4084f4c09c80d6ef778b42e141cb /drivers | |
parent | d3712b9dfcf44ca145cf87e7f4096fa2d923471a (diff) | |
download | linux-a7ed07d51c8abdb407be454c6cb6cfad613759d9.tar.xz |
net: fec: correct phy_name buffer length when init phy_name
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>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | 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 7b25e9cf13f6..1c7aad8fa19c 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)) { |