Skip to content

Commit

Permalink
virtio-rng: fix boot with virtio-rng device
Browse files Browse the repository at this point in the history
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: 08e53fb
  • Loading branch information
Sasha Levin authored and Rusty Russell committed May 18, 2014
1 parent 08e53fb commit e5d23a8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/char/hw_random/virtio-rng.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit e5d23a8

Please sign in to comment.