ia64/xen-unstable

changeset 13799:8132bf3ddbef

[LINUX] netfront: Don't call netif_carrier_off until the device is
fuly allocated.

netif_carrier_off() causes events to be queued on the device so if we
subsequently abort the allocation (e.g. due to lack of grant entries)
then we crash trying to access the now invalid device.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
author Ian Campbell <ian.campbell@xensource.com>
date Thu Feb 01 10:20:34 2007 +0000 (2007-02-01)
parents 588dd80b56b5
children b38ae44fa558
files linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c	Wed Jan 31 19:37:44 2007 +0000
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c	Thu Feb 01 10:20:34 2007 +0000
     1.3 @@ -1935,8 +1935,6 @@ static struct net_device * __devinit cre
     1.4  	np                   = netdev_priv(netdev);
     1.5  	np->xbdev            = dev;
     1.6  
     1.7 -	netif_carrier_off(netdev);
     1.8 -
     1.9  	spin_lock_init(&np->tx_lock);
    1.10  	spin_lock_init(&np->rx_lock);
    1.11  
    1.12 @@ -1991,6 +1989,9 @@ static struct net_device * __devinit cre
    1.13  	SET_NETDEV_DEV(netdev, &dev->dev);
    1.14  
    1.15  	np->netdev = netdev;
    1.16 +
    1.17 +	netif_carrier_off(netdev);
    1.18 +
    1.19  	return netdev;
    1.20  
    1.21   exit_free_tx: