Преглед на файлове

vfio/platform: fix a wrong returned value in vfio_populate_device

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>
Eric Auger преди 8 години
родител
ревизия
0d84f47bff
променени са 1 файла, в които са добавени 1 реда и са изтрити 0 реда
  1. 1 0
      hw/vfio/platform.c

+ 1 - 0
hw/vfio/platform.c

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