mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sasha Levin <sasha.levin@oracle.com>
To: rusty@rustcorp.com.au
Cc: mpm@selenic.com, herbert@gondor.apana.org.au,
	linux-kernel@vger.kernel.org, akong@redhat.com,
	Sasha Levin <sasha.levin@oracle.com>
Subject: [PATCH 1/2] virtio-rng: fix boot with virtio-rng device
Date: Thu, 15 May 2014 09:21:43 -0400	[thread overview]
Message-ID: <1400160104-1888-1-git-send-email-sasha.levin@oracle.com> (raw)

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


             reply	other threads:[~2014-05-15 13:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-15 13:21 Sasha Levin [this message]
2014-05-15 13:21 ` [PATCH 2/2] virtio-rng: fixes for device registration/unregistration Sasha Levin
2014-05-16  2:09 ` [PATCH 1/2] virtio-rng: fix boot with virtio-rng device Rusty Russell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1400160104-1888-1-git-send-email-sasha.levin@oracle.com \
    --to=sasha.levin@oracle.com \
    --cc=akong@redhat.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpm@selenic.com \
    --cc=rusty@rustcorp.com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®