Explorar o código

lguest: fix occasional crash in example launcher.

We usually got away with ->next on the final entry being NULL, but it
finally bit me.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: stable@kernel.org
Rusty Russell %!s(int64=12) %!d(string=hai) anos
pai
achega
ca16f580a5
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      tools/lguest/lguest.c

+ 1 - 0
tools/lguest/lguest.c

@@ -1299,6 +1299,7 @@ static struct device *new_device(const char *name, u16 type)
 	dev->feature_len = 0;
 	dev->num_vq = 0;
 	dev->running = false;
+	dev->next = NULL;
 
 	/*
 	 * Append to device list.  Prepending to a single-linked list is