diff options
author | Sasha Levin <sasha.levin@oracle.com> | 2014-05-16 04:11:57 +0200 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2014-05-19 01:56:38 +0200 |
commit | e5d23a8cc38c555f9f3a40dcc5d14030105df9a8 (patch) | |
tree | 714704de1f499d2b4d07815fbc0e48c7efc75975 /drivers | |
parent | virtio-rng: support multiple virtio-rng devices (diff) | |
download | linux-e5d23a8cc38c555f9f3a40dcc5d14030105df9a8.tar.xz linux-e5d23a8cc38c555f9f3a40dcc5d14030105df9a8.zip |
virtio-rng: fix boot with virtio-rng device
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
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/char/hw_random/virtio-rng.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/char/hw_random/virtio-rng.c b/drivers/char/hw_random/virtio-rng.c index 12e242bbb0f5..5b25daa7f798 100644 --- a/drivers/char/hw_random/virtio-rng.c +++ b/drivers/char/hw_random/virtio-rng.c @@ -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); |