From: Cornelia Huck Date: Tue, 16 Oct 2018 11:51:54 +0000 (+0200) Subject: s390x/vfio-ap: report correct error X-Git-Tag: v3.1.0-rc0~7^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ab17b1fc75d9b961bf88a109b74069a383eba49f;p=thirdparty%2Fqemu.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 Reviewed-by: Christian Borntraeger Reviewed-by: Thomas Huth Reviewed-by: Tony Krowiak Signed-off-by: Cornelia Huck --- diff --git a/hw/vfio/ap.c b/hw/vfio/ap.c index 3962bb74e57..65de952f442 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)); } }