ia64/xen-unstable

changeset 9288:890fa761ba82

Do not BUG when receiving unexpected message type from xenbus
print a warning and discard the query

Signed-off-by: Vincent Hanquez <vincent@xensource.com>
author vhanquez@kneesa.uk.xensource.com
date Wed Mar 15 11:09:45 2006 +0000 (2006-03-15)
parents f00e257d200c
children 2162e1356bee
files linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c	Wed Mar 15 10:33:43 2006 +0000
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c	Wed Mar 15 11:09:45 2006 +0000
     1.3 @@ -237,7 +237,14 @@ static void *xs_talkv(xenbus_transaction
     1.4  		return ERR_PTR(-err);
     1.5  	}
     1.6  
     1.7 -	BUG_ON(msg.type != type);
     1.8 +	if (msg.type != type) {
     1.9 +		if (printk_ratelimit())
    1.10 +			printk(KERN_WARNING
    1.11 +			       "XENBUS unexpected type [%d], expected [%d]\n",
    1.12 +			       msg.type, type);
    1.13 +		kfree(ret);
    1.14 +		return ERR_PTR(-EINVAL);
    1.15 +	}
    1.16  	return ret;
    1.17  }
    1.18