From: Nye Liu <nyet@nyet.org>
To: linux-kernel@vger.kernel.org
Cc: linuxppc-dev@ozlabs.org, netdev@vger.kernel.org
Subject: [PATCH] FS_ENET: Don't attempt to set mii_speed when fec_inf is null
Date: Fri, 27 Jun 2008 12:26:51 -0700 [thread overview]
Message-ID: <20080627192651.GA28291@curtisfong.org> (raw)
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);
/*
* Clear any outstanding interrupt.
next reply other threads:[~2008-06-27 19:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-27 19:26 Nye Liu [this message]
2008-06-27 21:29 ` [PATCH] FS_ENET: Don't attempt to set mii_speed when fec_inf is null Sergei Shtylyov
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=20080627192651.GA28291@curtisfong.org \
--to=nyet@nyet.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=netdev@vger.kernel.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).