]> xenbits.xensource.com Git - people/vhanquez/xen.git/commitdiff
Avoid using a separate watch thread due to uninitialised watch->flags.
authorKeir Fraser <keir.fraser@citrix.com>
Sat, 1 Mar 2008 09:27:10 +0000 (09:27 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Sat, 1 Mar 2008 09:27:10 +0000 (09:27 +0000)
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>
linux-2.6.18-xen changeset:   440:43de9d7c3c63adaac7e334621f763c94acbbc178
linux-2.6.18-xen date:        Tue Feb 26 17:59:18 2008 +0000

linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c

index 854982ee15506e1897791fd7e1e3cf8738aba3de..c04ede0118b2e85aafe110a523d72625b66f818b 100644 (file)
@@ -278,7 +278,7 @@ static ssize_t xenbus_dev_write(struct file *filp,
                token++;
 
                if (msg_type == XS_WATCH) {
-                       watch = kmalloc(sizeof(*watch), GFP_KERNEL);
+                       watch = kzalloc(sizeof(*watch), GFP_KERNEL);
                        watch->watch.node = kmalloc(strlen(path)+1,
                                                     GFP_KERNEL);
                        strcpy((char *)watch->watch.node, path);