WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] [LINUX] netfront: Don't call netif_carrie

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [LINUX] netfront: Don't call netif_carrier_off until the device is
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 01 Feb 2007 04:30:07 -0800
Delivery-date: Thu, 01 Feb 2007 04:30:18 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [LINUX] netfront: Don't call netif_carrier_off until the device is, Xen patchbot-unstable <=