lguest: fix occasional crash in example launcher.
Rusty Russell [Thu, 4 Oct 2012 02:33:25 +0000 (11:33 +0930)]
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

tools/lguest/lguest.c

index f759f4f..fd2f922 100644 (file)
@@ -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