qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] s390x/vfio-ap: report correct error
@ 2018-10-16 11:58 Cornelia Huck
  2018-10-16 12:56 ` Christian Borntraeger
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Cornelia Huck @ 2018-10-16 11:58 UTC (permalink / raw)
  To: Tony Krowiak, Christian Borntraeger, Halil Pasic, Pierre Morel
  Cc: Alex Williamson, Peter Maydell, qemu-s390x, qemu-devel,
	Cornelia Huck

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>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
 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.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-10-16 16:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-16 11:58 [Qemu-devel] [PATCH] s390x/vfio-ap: report correct error Cornelia Huck
2018-10-16 12:56 ` Christian Borntraeger
2018-10-16 13:29 ` [Qemu-devel] [qemu-s390x] " Thomas Huth
2018-10-16 14:56 ` [Qemu-devel] " Tony Krowiak
2018-10-16 16:44 ` Cornelia Huck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).