mirror of
https://github.com/torvalds/linux.git
synced 2024-12-15 15:41:58 +00:00
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: 08e53fbdb8
This commit is contained in:
parent
08e53fbdb8
commit
e5d23a8cc3
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user