ia64/linux-2.6.18-xen.hg

changeset 445:43de9d7c3c63

Avoid using a separate watch thread due to uninitialised watch->flags.

The xenbus_dev code isn't setup to handle the case where
XBWF_new_thread is set so there is a potetial crash if this flag is
erroneously set. Therefore initialise flags to zero by using kzalloc
rather than kmalloc.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
author Ian Campbell <ian.campbell@citrix.com>
date Tue Feb 26 17:59:18 2008 +0000 (2008-02-26)
parents 1edfea26a2a9
children c48f54365060
files drivers/xen/xenbus/xenbus_dev.c
line diff
     1.1 --- a/drivers/xen/xenbus/xenbus_dev.c	Mon Feb 25 09:15:12 2008 +0000
     1.2 +++ b/drivers/xen/xenbus/xenbus_dev.c	Tue Feb 26 17:59:18 2008 +0000
     1.3 @@ -278,7 +278,7 @@ static ssize_t xenbus_dev_write(struct f
     1.4  		token++;
     1.5  
     1.6  		if (msg_type == XS_WATCH) {
     1.7 -			watch = kmalloc(sizeof(*watch), GFP_KERNEL);
     1.8 +			watch = kzalloc(sizeof(*watch), GFP_KERNEL);
     1.9  			watch->watch.node = kmalloc(strlen(path)+1,
    1.10                                                      GFP_KERNEL);
    1.11  			strcpy((char *)watch->watch.node, path);