From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
To: Nye Liu <nyet@nyet.org>
Cc: linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org,
netdev@vger.kernel.org
Subject: Re: [PATCH] FS_ENET: Don't attempt to set mii_speed when fec_inf is null
Date: Sat, 28 Jun 2008 01:29:16 +0400 [thread overview]
Message-ID: <48655BAC.8080800@ru.mvista.com> (raw)
In-Reply-To: <20080627192651.GA28291@curtisfong.org>
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
next prev parent reply other threads:[~2008-06-27 21:29 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 [this message]
2008-06-27 22:07 ` Nye Liu
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=48655BAC.8080800@ru.mvista.com \
--to=sshtylyov@ru.mvista.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=netdev@vger.kernel.org \
--cc=nyet@nyet.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 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).