ia64/xen-unstable

changeset 12053:b2371c9e05f5

[NETFRONT] Make sure we don't crash if the backend goes to state
Closing before we have a chance to connect. This can happen if
there's an error while connecting.

Signed-off-by: Steven Smith <sos22@cam.ac.uk>
author Steven Smith <ssmith@xensource.com>
date Tue Oct 31 11:31:34 2006 +0000 (2006-10-31)
parents b21246720fde
children 79a40acadb41
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	Mon Oct 30 17:35:11 2006 +0000
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c	Tue Oct 31 11:31:34 2006 +0000
     1.3 @@ -522,7 +522,10 @@ static void backend_changed(struct xenbu
     1.4  		break;
     1.5  
     1.6  	case XenbusStateClosing:
     1.7 -		netfront_closing(dev);
     1.8 +		if (dev->state == XenbusStateConnected)
     1.9 +			netfront_closing(dev);
    1.10 +		else
    1.11 +			printk(KERN_DEBUG "Netfront: going to state Closing without being connected...\n");
    1.12  		break;
    1.13  	}
    1.14  }