lkml.org 
[lkml]   [2007]   [Nov]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] lguest: Fix uninitialized members in example launcher
Date
Thanks valgrind!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

diff -r 1041aeb944b2 Documentation/lguest/lguest.c
--- a/Documentation/lguest/lguest.c Tue Nov 13 15:11:06 2007 +1100
+++ b/Documentation/lguest/lguest.c Thu Nov 15 13:28:48 2007 +1100
@@ -1040,6 +1040,11 @@ static void add_virtqueue(struct device
/ getpagesize();
p = get_pages(pages);

+ /* Initialize the virtqueue */
+ vq->next = NULL;
+ vq->last_avail_idx = 0;
+ vq->dev = dev;
+
/* Initialize the configuration. */
vq->config.num = num_descs;
vq->config.irq = devices.next_irq++;
@@ -1056,9 +1061,6 @@ static void add_virtqueue(struct device
* second. */
for (i = &dev->vq; *i; i = &(*i)->next);
*i = vq;
-
- /* Link virtqueue back to device. */
- vq->dev = dev;

/* Set the routine to call when the Guest does something to this
* virtqueue. */
@@ -1093,6 +1095,7 @@ static struct device *new_device(const c
dev->desc = new_dev_desc(type);
dev->handle_input = handle_input;
dev->name = name;
+ dev->vq = NULL;
return dev;
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2007-11-19 01:13    [W:0.028 / U:0.284 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site