linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Nye Liu <nyet@nyet.org>
To: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: linuxppc-dev@ozlabs.org, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org
Subject: Re: [PATCH] FS_ENET: Don't attempt to set mii_speed when fec_inf is null
Date: Fri, 27 Jun 2008 15:07:49 -0700	[thread overview]
Message-ID: <20080627220749.GA3046@curtisfong.org> (raw)
In-Reply-To: <48655BAC.8080800@ru.mvista.com>

Sorry!

diff --git a/drivers/net/fs_enet/mac-fec.c b/drivers/net/fs_enet/mac-fec.c
index 8a311d1..7359068 100644
--- a/drivers/net/fs_enet/mac-fec.c
+++ b/drivers/net/fs_enet/mac-fec.c
@@ -328,7 +328,8 @@ static void restart(struct net_device *dev)
 	/*
 	 * Set MII speed.
 	 */
-	FW(fecp, mii_speed, fec_inf->mii_speed);
+	if (fec_inf)
+		FW(fecp, mii_speed, fec_inf->mii_speed);
 
 	/*
 	 * Clear any outstanding interrupt.

On Sat, Jun 28, 2008 at 01:29:16AM +0400, Sergei Shtylyov wrote:
> Hello.
>
> Nye Liu wrote:
>> From: Nye Liu <nyet@mrv.com>
>>
>> When using CONFIG_FIXED_PHY, fec_inf (fep->phydev->bus->priv) is NULL in
>> fs_enet/mac-fec.c restart(). Dereferencing fec_inf when trying to set the
>> mii_speed causes a kernel oops.
>>
>> Signed-off-by: Nye Liu <nyet@mrv.com>
>>
>> ---
>>
>> diff --git a/drivers/net/fs_enet/mac-fec.c b/drivers/net/fs_enet/mac-fec.c
>> index 8a311d1..350bc73 100644
>> --- a/drivers/net/fs_enet/mac-fec.c
>> +++ b/drivers/net/fs_enet/mac-fec.c
>> @@ -328,7 +328,8 @@ static void restart(struct net_device *dev)
>>         /*
>>          * Set MII speed.
>>          */
>> -       FW(fecp, mii_speed, fec_inf->mii_speed);
>> +       if (fec_inf)
>> +           FW(fecp, mii_speed, fec_inf->mii_speed);
>>   
>
>   Alas, Your patch is whitespace damaged.
>
>
> WBR, Sergei
>
>

  reply	other threads:[~2008-06-27 22:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-27 19:26 [PATCH] FS_ENET: Don't attempt to set mii_speed when fec_inf is null Nye Liu
2008-06-27 21:29 ` Sergei Shtylyov
2008-06-27 22:07   ` Nye Liu [this message]
2008-06-27 22:09 ` Nye Liu

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=20080627220749.GA3046@curtisfong.org \
    --to=nyet@nyet.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=netdev@vger.kernel.org \
    --cc=sshtylyov@ru.mvista.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;
as well as URLs for NNTP newsgroup(s).