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

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



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1204363630 0
# Node ID 347ccfd94d491ada99445a5432b730dcba4f265d
# Parent  215fb8f1f8107131936cf31d69e5b299186a3f83
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>
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 |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -r 215fb8f1f810 -r 347ccfd94d49 
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c
--- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c      Tue Feb 26 
15:06:42 2008 +0000
+++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c      Sat Mar 01 
09:27:10 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®.