[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [linux-2.6.18-xen] Avoid using a separate watch thread due to uninitialised watch->flags.



# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1204048758 0
# Node ID 43de9d7c3c63adaac7e334621f763c94acbbc178
# Parent  1edfea26a2a9d1b482f774fbf4cd113e7651ce3a
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@xxxxxxxxxx>
---
 drivers/xen/xenbus/xenbus_dev.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -r 1edfea26a2a9 -r 43de9d7c3c63 drivers/xen/xenbus/xenbus_dev.c
--- a/drivers/xen/xenbus/xenbus_dev.c   Mon Feb 25 09:15:12 2008 +0000
+++ b/drivers/xen/xenbus/xenbus_dev.c   Tue Feb 26 17:59:18 2008 +0000
@@ -278,7 +278,7 @@ static ssize_t xenbus_dev_write(struct f
                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);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.