From: Steven Smith Date: Tue, 31 Oct 2006 11:31:34 +0000 (+0000) Subject: [NETFRONT] Make sure we don't crash if the backend goes to state X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15567^2~172 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=937f23487a2784df020112d67eff7eb58987bcc3;p=xen.git [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 --- diff --git a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c index e03e44a05a..1324345f94 100644 --- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c +++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c @@ -522,7 +522,10 @@ static void backend_changed(struct xenbus_device *dev, break; case XenbusStateClosing: - netfront_closing(dev); + if (dev->state == XenbusStateConnected) + netfront_closing(dev); + else + printk(KERN_DEBUG "Netfront: going to state Closing without being connected...\n"); break; } }