Linux virtualization list
 help / color / mirror / Atom feed
* [PATCH] virtio: fix "warning: ‘queue’ may be used uninitialized"
@ 2016-04-04 18:14 Jeff Mahoney
  2016-04-05  8:04 ` Michael S. Tsirkin
  0 siblings, 1 reply; 4+ messages in thread
From: Jeff Mahoney @ 2016-04-04 18:14 UTC (permalink / raw)
  To: Michael S. Tsirkin, virtualization

This fixes the following warning:
drivers/virtio/virtio_ring.c:1032:5: warning: ‘queue’ may be used
uninitialized in this function

The conditions that govern when queue is set aren't apparent to gcc.

Setting queue = NULL clears the warning.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
---

 drivers/virtio/virtio_ring.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- 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;

-- 
Jeff Mahoney
SUSE Labs
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-04-05 14:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-04 18:14 [PATCH] virtio: fix "warning: ‘queue’ may be used uninitialized" Jeff Mahoney
2016-04-05  8:04 ` Michael S. Tsirkin
2016-04-05 13:34   ` Jeff Mahoney
2016-04-05 14:00     ` Michael S. Tsirkin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox