From: Cornelia Huck <cohuck@redhat.com>
To: Tony Krowiak <akrowiak@linux.ibm.com>,
Christian Borntraeger <borntraeger@de.ibm.com>,
Halil Pasic <pasic@linux.ibm.com>,
Pierre Morel <pmorel@linux.ibm.com>
Cc: Alex Williamson <alex.williamson@redhat.com>,
Peter Maydell <peter.maydell@linaro.org>,
qemu-s390x@nongnu.org, qemu-devel@nongnu.org,
Cornelia Huck <cohuck@redhat.com>
Subject: [Qemu-devel] [PATCH] s390x/vfio-ap: report correct error
Date: Tue, 16 Oct 2018 13:58:17 +0200 [thread overview]
Message-ID: <20181016115817.14605-1-cohuck@redhat.com> (raw)
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
next reply other threads:[~2018-10-16 11:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-16 11:58 Cornelia Huck [this message]
2018-10-16 12:56 ` [Qemu-devel] [PATCH] s390x/vfio-ap: report correct error 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181016115817.14605-1-cohuck@redhat.com \
--to=cohuck@redhat.com \
--cc=akrowiak@linux.ibm.com \
--cc=alex.williamson@redhat.com \
--cc=borntraeger@de.ibm.com \
--cc=pasic@linux.ibm.com \
--cc=peter.maydell@linaro.org \
--cc=pmorel@linux.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).