[PATCH for 2.6.24][NET] fs_enet: check for phydev existence in the ethtool handlers

Scott Wood scottwood at freescale.com
Fri Jan 11 04:27:08 EST 2008


Heiko Schocher wrote:
> diff --git a/drivers/net/fs_enet/fs_enet-main.c b/drivers/net/fs_enet/fs_enet-main.c
> index f2a4d39..f432a18 100644
> --- a/drivers/net/fs_enet/fs_enet-main.c
> +++ b/drivers/net/fs_enet/fs_enet-main.c
> @@ -810,6 +810,10 @@ static int fs_enet_open(struct net_device *dev)
>  	if (fep->fpi->use_napi)
>  		napi_enable(&fep->napi);
> 
> +	/* to initialize the fep->cur_rx,... */
> +	/* not doing this, will cause a crash in fs_enet_rx_napi */
> +	fs_init_bds(fep->ndev);

We should do this just before napi_enable() rather than just after, to 
eliminate any chance of a race window.

Looks good otherwise.

-Scott



More information about the Linuxppc-dev mailing list