From patchwork Mon Jan 30 08:08:12 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Zhao X-Patchwork-Id: 6430 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 4C11B23E92 for ; Mon, 30 Jan 2012 08:08:20 +0000 (UTC) Received: from mail-bk0-f52.google.com (mail-bk0-f52.google.com [209.85.214.52]) by fiordland.canonical.com (Postfix) with ESMTP id 0AF06A18680 for ; Mon, 30 Jan 2012 08:08:20 +0000 (UTC) Received: by bkar19 with SMTP id r19so3917002bka.11 for ; Mon, 30 Jan 2012 00:08:19 -0800 (PST) Received: by 10.204.10.82 with SMTP id o18mr8191050bko.20.1327910899713; Mon, 30 Jan 2012 00:08:19 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.204.130.220 with SMTP id u28cs144183bks; Mon, 30 Jan 2012 00:08:18 -0800 (PST) Received: by 10.68.212.73 with SMTP id ni9mr40346048pbc.82.1327910896610; Mon, 30 Jan 2012 00:08:16 -0800 (PST) Received: from TX2EHSOBE001.bigfish.com (tx2ehsobe005.messaging.microsoft.com. [65.55.88.15]) by mx.google.com with ESMTPS id h6si21341346pbn.96.2012.01.30.00.08.14 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 30 Jan 2012 00:08:16 -0800 (PST) Received-SPF: neutral (google.com: 65.55.88.15 is neither permitted nor denied by best guess record for domain of richard.zhao@linaro.org) client-ip=65.55.88.15; Authentication-Results: mx.google.com; spf=neutral (google.com: 65.55.88.15 is neither permitted nor denied by best guess record for domain of richard.zhao@linaro.org) smtp.mail=richard.zhao@linaro.org Received: from mail88-tx2-R.bigfish.com (10.9.14.236) by TX2EHSOBE001.bigfish.com (10.9.40.21) with Microsoft SMTP Server id 14.1.225.23; Mon, 30 Jan 2012 08:08:13 +0000 Received: from mail88-tx2 (localhost [127.0.0.1]) by mail88-tx2-R.bigfish.com (Postfix) with ESMTP id ACB0E6009D; Mon, 30 Jan 2012 08:08:13 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275dhz2dhc1bhc31hc1ah87h2a8h668h839h) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-FB-DOMAIN-IP-MATCH: fail Received: from mail88-tx2 (localhost.localdomain [127.0.0.1]) by mail88-tx2 (MessageSwitch) id 1327910890666605_30953; Mon, 30 Jan 2012 08:08:10 +0000 (UTC) Received: from TX2EHSMHS025.bigfish.com (unknown [10.9.14.242]) by mail88-tx2.bigfish.com (Postfix) with ESMTP id 9C38F80178; Mon, 30 Jan 2012 08:08:10 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by TX2EHSMHS025.bigfish.com (10.9.99.125) with Microsoft SMTP Server (TLS) id 14.1.225.23; Mon, 30 Jan 2012 08:08:07 +0000 Received: from az33smr01.freescale.net (10.64.34.199) by 039-SN1MMR1-001.039d.mgd.msft.net (10.84.1.13) with Microsoft SMTP Server id 14.1.355.3; Mon, 30 Jan 2012 02:08:07 -0600 Received: from b20223-02.ap.freescale.net (b20223-02.ap.freescale.net [10.192.242.124]) by az33smr01.freescale.net (8.13.1/8.13.0) with ESMTP id q0U882xF018779; Mon, 30 Jan 2012 02:08:03 -0600 (CST) From: Richard Zhao To: CC: , , , , , , Richard Zhao Subject: [PATCH 1/1] net: fec: correct phy_name buffer length when init phy_name Date: Mon, 30 Jan 2012 16:08:12 +0800 Message-ID: <1327910892-11251-1-git-send-email-richard.zhao@linaro.org> X-Mailer: git-send-email 1.7.5.4 MIME-Version: 1.0 X-OriginatorOrg: sigmatel.com 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 Acked-by: Shawn Guo Acked-by: Florian Fainelli --- 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)) {