lkml.org 
[lkml]   [2014]   [May]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/2] virtio-rng: fix boot with virtio-rng device
Date
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>
---

Also, do we really need multiple virtio-rng devices? I know it's
nice to have, but if there isn't a solid use-case behind it we're
just adding bugs to working code without any benefit.


drivers/char/hw_random/virtio-rng.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/char/hw_random/virtio-rng.c b/drivers/char/hw_random/virtio-rng.c
index 12e242b..5b25daa 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);

--
1.7.10.4


\
 
 \ /
  Last update: 2014-05-15 16:21    [W:0.029 / U:0.720 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site