Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d1c856e0 authored by Rusty Russell's avatar Rusty Russell
Browse files

lguest: Fix uninitialized members in example launcher



Thanks valgrind!

Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent 2ffbb837
Loading
Loading
Loading
Loading
+6 −3
Original line number Original line Diff line number Diff line
@@ -1040,6 +1040,11 @@ static void add_virtqueue(struct device *dev, unsigned int num_descs,
		/ getpagesize();
		/ getpagesize();
	p = get_pages(pages);
	p = get_pages(pages);


	/* Initialize the virtqueue */
	vq->next = NULL;
	vq->last_avail_idx = 0;
	vq->dev = dev;

	/* Initialize the configuration. */
	/* Initialize the configuration. */
	vq->config.num = num_descs;
	vq->config.num = num_descs;
	vq->config.irq = devices.next_irq++;
	vq->config.irq = devices.next_irq++;
@@ -1057,9 +1062,6 @@ static void add_virtqueue(struct device *dev, unsigned int num_descs,
	for (i = &dev->vq; *i; i = &(*i)->next);
	for (i = &dev->vq; *i; i = &(*i)->next);
	*i = vq;
	*i = vq;


	/* Link virtqueue back to device. */
	vq->dev = dev;

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