qemu-s390x
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[qemu-s390x] [PULL 1/6] s390x/vfio-ap: report correct error


From: Cornelia Huck
Subject: [qemu-s390x] [PULL 1/6] s390x/vfio-ap: report correct error
Date: Mon, 5 Nov 2018 17:43:35 +0100

If ioctl(..., VFIO_DEVICE_RESET) fails, we want to report errno
instead of ret (which is always -1 on error).

Fixes Coverity issue CID 1396176.

Reported-by: Peter Maydell <address@hidden>
Reviewed-by: Christian Borntraeger <address@hidden>
Reviewed-by: Thomas Huth <address@hidden>
Reviewed-by: Tony Krowiak <address@hidden>
Signed-off-by: Cornelia Huck <address@hidden>
---
 hw/vfio/ap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/vfio/ap.c b/hw/vfio/ap.c
index 3962bb74e5..65de952f44 100644
--- a/hw/vfio/ap.c
+++ b/hw/vfio/ap.c
@@ -142,7 +142,7 @@ static void vfio_ap_reset(DeviceState *dev)
     ret = ioctl(vapdev->vdev.fd, VFIO_DEVICE_RESET);
     if (ret) {
         error_report("%s: failed to reset %s device: %s", __func__,
-                     vapdev->vdev.name, strerror(ret));
+                     vapdev->vdev.name, strerror(errno));
     }
 }
 
-- 
2.14.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]