mirror of https://github.com/xqemu/xqemu.git
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:
parent
7d56239f15
commit
ab17b1fc75
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue