ia64/xen-unstable

changeset 9368:02260f77c035

Only send the OFFLINE hotplug event if be->netif is set. Firstly, this ensures
that OFFLINE is only sent if the ONLINE event has been sent. Secondly, this
fixes one possible cause of the reopened bug #549 as it prevents be->netif
being dereferenced inside netback_uevent. Early reports suggest that this is
not the only cause of #549, so that bug remains open for now.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author emellor@leeni.uk.xensource.com
date Tue Mar 21 12:25:23 2006 +0100 (2006-03-21)
parents 14c26df4f33c
children 045bee6e1ebd
files linux-2.6-xen-sparse/drivers/xen/netback/xenbus.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/xen/netback/xenbus.c	Tue Mar 21 12:21:08 2006 +0100
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netback/xenbus.c	Tue Mar 21 12:25:23 2006 +0100
     1.3 @@ -213,7 +213,8 @@ static void frontend_changed(struct xenb
     1.4  		break;
     1.5  
     1.6  	case XenbusStateClosed:
     1.7 -		kobject_uevent(&dev->dev.kobj, KOBJ_OFFLINE);
     1.8 +		if (be->netif != NULL)
     1.9 +			kobject_uevent(&dev->dev.kobj, KOBJ_OFFLINE);
    1.10  		device_unregister(&dev->dev);
    1.11  		break;
    1.12