All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] virtio-rng: cope if struct hwrng.name is changed to const
@ 2014-05-15  5:31 Stephen Rothwell
  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
  0 siblings, 2 replies; 4+ messages in thread
From: Stephen Rothwell @ 2014-05-15  5:31 UTC (permalink / raw)
  To: Rusty Russell; +Cc: Amos Kong, linux-kernel

[-- 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 --]

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-05-19  1:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-15  5:31 [PATCH 1/2] virtio-rng: cope if struct hwrng.name is changed to const Stephen Rothwell
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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.