[PATCH] virtio: silence compiler warning
From: Jiri Benc
Date: Wed Apr 27 2016 - 05:34:31 EST
gcc 4.8.5 emits the following false positive:
drivers/virtio/virtio_ring.c: In function 'vring_create_virtqueue':
drivers/virtio/virtio_ring.c:1032:5: warning: 'queue' may be used uninitialized in this function [-Wmaybe-uninitialized]
Silence it.
Signed-off-by: Jiri Benc <jbenc@xxxxxxxxxx>
---
drivers/virtio/virtio_ring.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index 5c802d47892c..ca6bfddaacad 100644
--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -1006,7 +1006,7 @@ struct virtqueue *vring_create_virtqueue(
const char *name)
{
struct virtqueue *vq;
- void *queue;
+ void *queue = NULL;
dma_addr_t dma_addr;
size_t queue_size_in_bytes;
struct vring vring;
--
1.8.3.1