ia64/xen-unstable

changeset 13026:79315be2c9b9

[NET] front: Fix crashes when xenstore watches fire multiple times.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Thu Dec 14 12:21:28 2006 +0000 (2006-12-14)
parents c3ff06093028
children 7fdf6e0f12db
files linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c	Thu Dec 14 12:02:30 2006 +0000
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c	Thu Dec 14 12:21:28 2006 +0000
     1.3 @@ -525,6 +525,8 @@ static void backend_changed(struct xenbu
     1.4  		break;
     1.5  
     1.6  	case XenbusStateInitWait:
     1.7 +		if (dev->state != XenbusStateInitialising)
     1.8 +			break;
     1.9  		if (network_connect(netdev) != 0)
    1.10  			break;
    1.11  		xenbus_switch_state(dev, XenbusStateConnected);
    1.12 @@ -532,6 +534,8 @@ static void backend_changed(struct xenbu
    1.13  		break;
    1.14  
    1.15  	case XenbusStateClosing:
    1.16 +		if (dev->state == XenbusStateClosed)
    1.17 +			break;
    1.18  		netfront_closing(dev);
    1.19  		break;
    1.20  	}
     2.1 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c	Thu Dec 14 12:02:30 2006 +0000
     2.2 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c	Thu Dec 14 12:21:28 2006 +0000
     2.3 @@ -487,6 +487,8 @@ int xenbus_probe_node(struct xen_bus_typ
     2.4  	if (!xendev)
     2.5  		return -ENOMEM;
     2.6  
     2.7 +	xendev->state = XenbusStateInitialising;
     2.8 +
     2.9  	/* Copy the strings into the extra space. */
    2.10  
    2.11  	tmpstring = (char *)(xendev + 1);