[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140515153140.49b8028b@canb.auug.org.au>
Date: Thu, 15 May 2014 15:31:40 +1000
From: Stephen Rothwell <sfr@...b.auug.org.au>
To: Rusty Russell <rusty@...tcorp.com.au>
Cc: Amos Kong <akong@...hat.com>, linux-kernel@...r.kernel.org
Subject: [PATCH 1/2] virtio-rng: cope if struct hwrng.name is changed to
const
Signed-off-by: Stephen Rothwell <sfr@...b.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@...b.auug.org.au
Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)
Powered by blists - more mailing lists