]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
virtio-rng: fix boot with virtio-rng device
authorSasha Levin <sasha.levin@oracle.com>
Fri, 16 May 2014 02:11:57 +0000 (11:41 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Sun, 18 May 2014 23:56:38 +0000 (09:26 +0930)
Commit "virtio-rng: support multiple virtio-rng devices" has broken
boot with a virtio-rng device because the 'init' callback of the
virtio-rng device was left unitialized to garbage, and got called
by the hwrng infrastructure, killing the guest on boot.

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Fixes: 08e53fbdb85c0f6f45c0f7c1ea3defc1752a95ce
drivers/char/hw_random/virtio-rng.c

index 12e242bbb0f50c7817fb321241cd8f0e6b3497bb..5b25daa7f798a1da01fd3bad3893275cb918c9a5 100644 (file)
@@ -95,7 +95,7 @@ static int probe_common(struct virtio_device *vdev)
        int err, i;
        struct virtrng_info *vi = NULL;
 
-       vi = kmalloc(sizeof(struct virtrng_info), GFP_KERNEL);
+       vi = kzalloc(sizeof(struct virtrng_info), GFP_KERNEL);
        vi->hwrng.name = kmalloc(40, GFP_KERNEL);
        init_completion(&vi->have_data);