Xin Long
2016-Apr-24 16:50 UTC
[PATCH] virtio: queue variable should be initialized in vring_create_virtqueue
'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 at gmail.com> --- 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
Possibly Parallel Threads
- [PATCH] virtio: queue variable should be initialized in vring_create_virtqueue
- [patch] virtio: Silence uninitialized variable warning
- [patch] virtio: Silence uninitialized variable warning
- [PATCH v6 6/9] virtio: Add improved queue allocation API
- [PATCH] virtio: fix "warning: ‘queue’ may be used uninitialized"