lkml.org 
[lkml]   [2008]   [Jun]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] FS_ENET: Don't attempt to set mii_speed when fec_inf is null
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
>
>


\
 
 \ /
  Last update: 2008-06-28 00:13    [W:0.031 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site