]> git.proxmox.com Git - mirror_qemu.git/commitdiff
vfio/platform: fix a wrong returned value in vfio_populate_device
authorEric Auger <eric.auger@redhat.com>
Mon, 17 Oct 2016 16:58:00 +0000 (10:58 -0600)
committerAlex Williamson <alex.williamson@redhat.com>
Mon, 17 Oct 2016 16:58:00 +0000 (10:58 -0600)
In case the vfio_init_intp fails we currently do not return an
error value. This patch fixes the bug. The returned value is not
explicit but in practice the error object is the one used to
report the error to the end-user and the actual returned error
value is not used.

Signed-off-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
hw/vfio/platform.c

index 1a35da04c3317a125b43db7aa31d3160bb9f3cfa..484e31f23316147b62800189ce6276a87f3a91fe 100644 (file)
@@ -508,6 +508,7 @@ static int vfio_populate_device(VFIODevice *vbasedev, Error **errp)
                                                     irq.flags);
             intp = vfio_init_intp(vbasedev, irq, errp);
             if (!intp) {
+                ret = -1;
                 goto irq_err;
             }
         }