diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2016-04-15 10:45:10 -0400 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2016-05-01 08:50:08 -0400 |
commit | e00f7bd221292b318d4d09c3f0c2c8af9b1e5edf (patch) | |
tree | 86ca592852d959e65ee9038d10ddd8532eb92c02 /drivers/virtio | |
parent | d4f6e272f2600bc1295d195a52a9e8bb81656bc7 (diff) |
virtio: Silence uninitialized variable warning
Smatch complains that we might not initialize "queue". The issue is
callers like setup_vq() from virtio_pci_modern.c where "num" could be
something like 2 and "vring_align" is 64. In that case, vring_size() is
less than PAGE_SIZE. It won't happen in real life, but we're getting
the value of "num" from a register so it's not really possible to tell
what value it holds with static analysis.
Let's just silence the warning.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'drivers/virtio')
-rw-r--r-- | drivers/virtio/virtio_ring.c | 2 |
1 files changed, 1 insertions, 1 deletions
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( | |||
1006 | const char *name) | 1006 | const char *name) |
1007 | { | 1007 | { |
1008 | struct virtqueue *vq; | 1008 | struct virtqueue *vq; |
1009 | void *queue; | 1009 | void *queue = NULL; |
1010 | dma_addr_t dma_addr; | 1010 | dma_addr_t dma_addr; |
1011 | size_t queue_size_in_bytes; | 1011 | size_t queue_size_in_bytes; |
1012 | struct vring vring; | 1012 | struct vring vring; |