linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] FS_ENET: Don't attempt to set mii_speed when fec_inf is null
@ 2008-06-27 19:26 Nye Liu
  2008-06-27 21:29 ` Sergei Shtylyov
  2008-06-27 22:09 ` Nye Liu
  0 siblings, 2 replies; 4+ messages in thread
From: Nye Liu @ 2008-06-27 19:26 UTC (permalink / raw)
  To: linux-kernel; +Cc: linuxppc-dev, netdev

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.

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-06-27 22:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2008-06-27 22:09 ` Nye Liu

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).