]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commitdiff
virtio-pci: build for uninitialized return value in vq_vector_unmask
authorMichael Roth <mdroth@linux.vnet.ibm.com>
Mon, 14 Jan 2013 19:20:12 +0000 (13:20 -0600)
committerAnthony Liguori <aliguori@us.ibm.com>
Mon, 14 Jan 2013 19:36:12 +0000 (13:36 -0600)
Fixes the following:

/home/mdroth/w/qemu2.git/hw/virtio-pci.c: In function
‘kvm_virtio_pci_vector_unmask’:
/home/mdroth/w/qemu2.git/hw/virtio-pci.c:673:12: error: ‘ret’ may be
used uninitialized in this function [-Werror=uninitialized]
cc1: all warnings being treated as errors
make: *** [hw/virtio-pci.o] Error 1
make: *** Waiting for unfinished jobs....

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
hw/virtio-pci.c

index 0b497399466aae652115a6e5fe228ad6eb38e7b1..09342463ad33c439087ecb90402bcde51fb315c7 100644 (file)
@@ -616,7 +616,7 @@ static int kvm_virtio_pci_vq_vector_unmask(VirtIOPCIProxy *proxy,
     VirtQueue *vq = virtio_get_queue(proxy->vdev, queue_no);
     EventNotifier *n = virtio_queue_get_guest_notifier(vq);
     VirtIOIRQFD *irqfd = &proxy->vector_irqfd[vector];
-    int ret;
+    int ret = 0;
 
     if (irqfd->msg.data != msg.data || irqfd->msg.address != msg.address) {
         ret = kvm_irqchip_update_msi_route(kvm_state, irqfd->virq, msg);