diff mbox

[v5,12/17] vfio/platform: fix a wrong returned value in vfio_populate_device

Message ID 1475770058-20409-13-git-send-email-eric.auger@redhat.com
State New
Headers show

Commit Message

Eric Auger Oct. 6, 2016, 4:07 p.m. UTC
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>

---
---
 hw/vfio/platform.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox

Patch

diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c
index 1a35da0..484e31f 100644
--- a/hw/vfio/platform.c
+++ b/hw/vfio/platform.c
@@ -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;
             }
         }