diff options
author | Cornelia Huck <cohuck@redhat.com> | 2018-10-16 13:51:54 +0200 |
---|---|---|
committer | Cornelia Huck <cohuck@redhat.com> | 2018-11-05 09:55:01 +0100 |
commit | ab17b1fc75d9b961bf88a109b74069a383eba49f (patch) | |
tree | aee4f4503a70f48c438762428f73bfa4fcbd3985 /hw/vfio | |
parent | 7d56239f159afc2e7bd42623947e56ba48f37836 (diff) | |
download | qemu-ab17b1fc75d9b961bf88a109b74069a383eba49f.zip qemu-ab17b1fc75d9b961bf88a109b74069a383eba49f.tar.gz qemu-ab17b1fc75d9b961bf88a109b74069a383eba49f.tar.bz2 |
s390x/vfio-ap: report correct error
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 <peter.maydell@linaro.org>
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Tony Krowiak <akrowiak@linux.ibm.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
Diffstat (limited to 'hw/vfio')
-rw-r--r-- | hw/vfio/ap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/vfio/ap.c b/hw/vfio/ap.c index 3962bb7..65de952 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)); } } |