mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: Amos Kong <akong@redhat.com>, linux-kernel@vger.kernel.org
Subject: [PATCH 1/2] virtio-rng: cope if struct hwrng.name is changed to const
Date: Thu, 15 May 2014 15:31:40 +1000	[thread overview]
Message-ID: <20140515153140.49b8028b@canb.auug.org.au> (raw)

[-- Attachment #1: Type: text/plain, Size: 1156 bytes --]


Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 drivers/char/hw_random/virtio-rng.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Based on the current virtio tree in linux-next.

diff --git a/drivers/char/hw_random/virtio-rng.c b/drivers/char/hw_random/virtio-rng.c
index 12e242bbb0f5..6319b133b7aa 100644
--- a/drivers/char/hw_random/virtio-rng.c
+++ b/drivers/char/hw_random/virtio-rng.c
@@ -94,9 +94,11 @@ static int probe_common(struct virtio_device *vdev)
 {
 	int err, i;
 	struct virtrng_info *vi = NULL;
+	char *name;
 
 	vi = kmalloc(sizeof(struct virtrng_info), GFP_KERNEL);
-	vi->hwrng.name = kmalloc(40, GFP_KERNEL);
+	name = kmalloc(40, GFP_KERNEL);
+	vi->hwrng.name = name;
 	init_completion(&vi->have_data);
 
 	vi->hwrng.read = virtio_read;
@@ -117,7 +119,7 @@ static int probe_common(struct virtio_device *vdev)
 
 	i = 0;
 	do {
-		sprintf(vi->hwrng.name, "virtio_rng.%d", i++);
+		sprintf(name, "virtio_rng.%d", i++);
 		err = hwrng_register(&vi->hwrng);
 	} while (err == -EEXIST);
 
-- 
2.0.0.rc2

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

             reply	other threads:[~2014-05-15  5:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-15  5:31 Stephen Rothwell [this message]
2014-05-15  5:33 ` [PATCH 2/2] virtio-rng: some small tidy ups around kmalloc Stephen Rothwell
2014-05-19  0:00 ` [PATCH 1/2] virtio-rng: cope if struct hwrng.name is changed to const Rusty Russell
2014-05-19  1:55   ` Stephen Rothwell

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=20140515153140.49b8028b@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=akong@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --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®