[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] [LINUX] netfront: Don't call netif_carrier_off until the device is



# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxxxxx>
# Date 1170325234 0
# Node ID 8132bf3ddbef6901f39694a7a9024bd92fb2a91a
# Parent  588dd80b56b5411bd9d1860e9e19da39a64e2f5d
[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@xxxxxxxxxxxxx>
---
 linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff -r 588dd80b56b5 -r 8132bf3ddbef 
linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c
--- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c      Wed Jan 31 
19:37:44 2007 +0000
+++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c      Thu Feb 01 
10:20:34 2007 +0000
@@ -1935,8 +1935,6 @@ static struct net_device * __devinit cre
        np                   = netdev_priv(netdev);
        np->xbdev            = dev;
 
-       netif_carrier_off(netdev);
-
        spin_lock_init(&np->tx_lock);
        spin_lock_init(&np->rx_lock);
 
@@ -1991,6 +1989,9 @@ static struct net_device * __devinit cre
        SET_NETDEV_DEV(netdev, &dev->dev);
 
        np->netdev = netdev;
+
+       netif_carrier_off(netdev);
+
        return netdev;
 
  exit_free_tx:

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.