[PATCH] virtio: queue variable should be initialized in vring_create_virtqueue

From: Xin Long
Date: Sun Apr 24 2016 - 12:50:21 EST


'queue' may be used uninitialized in vring_create_virtqueue, actually
when we compile kernel, gcc can also give this warning.

Fixes: 2a2d1382fe9d ("virtio: Add improved queue allocation API")
Signed-off-by: Xin Long <lucien.xin@xxxxxxxxx>
---
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 5c802d4..ca6bfdd 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;
--
2.1.0