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>
This commit is contained in:
Cornelia Huck 2018-10-16 13:51:54 +02:00
parent 7d56239f15
commit ab17b1fc75
1 changed files with 1 additions and 1 deletions

View File

@ -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));
}
}