Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e5d23a8c authored by Sasha Levin's avatar Sasha Levin Committed by Rusty Russell
Browse files

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: default avatarSasha Levin <sasha.levin@oracle.com>
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
Fixes: 08e53fbd
parent 08e53fbd
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -95,7 +95,7 @@ static int probe_common(struct virtio_device *vdev)
	int err, i;
	int err, i;
	struct virtrng_info *vi = NULL;
	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);
	vi->hwrng.name = kmalloc(40, GFP_KERNEL);
	init_completion(&vi->have_data);
	init_completion(&vi->have_data);