Re: [PATCH] FS_ENET: Don't attempt to set mii_speed when fec_infis null

From: Sergei Shtylyov
Date: Fri Jun 27 2008 - 17:29:37 EST


Hello.

Nye Liu wrote:
From: Nye Liu <nyet@xxxxxxx>

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@xxxxxxx>

---

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


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/