From: florian@openwrt.org (Florian Fainelli)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/1] net: fec: correct phy_name buffer length when init phy_name
Date: Mon, 30 Jan 2012 12:07:00 +0100 [thread overview]
Message-ID: <4F2679D4.5070404@openwrt.org> (raw)
In-Reply-To: <20120130095134.GA11428@S2101-09.ap.freescale.net>
On 01/30/12 10:51, Shawn Guo wrote:
> On Mon, Jan 30, 2012 at 04:08:12PM +0800, Richard Zhao wrote:
>> 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>
>
> Since this patch fixes a regression seen on v3.3-rc1, it may be
> suitable for -rc series.
>
> The offending commit for the regression would be 391420f
> (fec: use an unique MDIO bus name.) which increases the string
> length of fep->mii_bus->id consequently mdio_bus_id.
Looks good to me since I introduced that "regression", but you already
had a bug before my patch.
Acked-by: Florian Fainelli <florian@openwrt.org>
>
> Regards,
> Shawn
>
>> ---
>> 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
>>
>>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
WARNING: multiple messages have this Message-ID (diff)
From: Florian Fainelli <florian@openwrt.org>
To: Shawn Guo <shawn.guo@linaro.org>
Cc: Richard Zhao <richard.zhao@linaro.org>,
netdev@vger.kernel.org, davem@davemloft.net,
u.kleine-koenig@pengutronix.de, LW@KARO-electronics.de,
linux-arm-kernel@lists.infradead.org, patches@linaro.org
Subject: Re: [PATCH 1/1] net: fec: correct phy_name buffer length when init phy_name
Date: Mon, 30 Jan 2012 12:07:00 +0100 [thread overview]
Message-ID: <4F2679D4.5070404@openwrt.org> (raw)
In-Reply-To: <20120130095134.GA11428@S2101-09.ap.freescale.net>
On 01/30/12 10:51, Shawn Guo wrote:
> On Mon, Jan 30, 2012 at 04:08:12PM +0800, Richard Zhao wrote:
>> 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>
>
> Since this patch fixes a regression seen on v3.3-rc1, it may be
> suitable for -rc series.
>
> The offending commit for the regression would be 391420f
> (fec: use an unique MDIO bus name.) which increases the string
> length of fep->mii_bus->id consequently mdio_bus_id.
Looks good to me since I introduced that "regression", but you already
had a bug before my patch.
Acked-by: Florian Fainelli <florian@openwrt.org>
>
> Regards,
> Shawn
>
>> ---
>> 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
>>
>>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2012-01-30 11:07 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-30 8:08 [PATCH 1/1] net: fec: correct phy_name buffer length when init phy_name Richard Zhao
2012-01-30 8:08 ` Richard Zhao
2012-01-30 9:51 ` Shawn Guo
2012-01-30 9:51 ` Shawn Guo
2012-01-30 11:07 ` Florian Fainelli [this message]
2012-01-30 11:07 ` Florian Fainelli
2012-01-31 21:18 ` David Miller
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=4F2679D4.5070404@openwrt.org \
--to=florian@openwrt.org \
--cc=linux-arm-kernel@lists.infradead.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.