From: Alex Williamson <alex.williamson@redhat.com>
To: qemu-devel@nongnu.org
Subject: [PULL 2/3] vfio: don't ignore return value of migrate_add_blocker
Date: Mon, 18 Nov 2019 11:46:53 -0700 [thread overview]
Message-ID: <157410280915.24655.2269183247539766479.stgit@gimli.home> (raw)
In-Reply-To: <157410270703.24655.9333886493163056872.stgit@gimli.home>
From: Jens Freimann <jfreimann@redhat.com>
When an error occurs in migrate_add_blocker() it sets a
negative return value and uses error pointer we pass in.
Instead of just looking at the error pointer check for a negative return
value and avoid a coverity error because the return value is
set but never used. This fixes CID 1407219.
Reported-by: Coverity (CID 1407219)
Fixes: f045a0104c8c ("vfio: unplug failover primary device before migration")
Signed-off-by: Jens Freimann <jfreimann@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
---
hw/vfio/pci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index 9c165995df32..0c55883bba77 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -2737,7 +2737,7 @@ static void vfio_realize(PCIDevice *pdev, Error **errp)
error_setg(&vdev->migration_blocker,
"VFIO device doesn't support migration");
ret = migrate_add_blocker(vdev->migration_blocker, &err);
- if (err) {
+ if (ret) {
error_propagate(errp, err);
error_free(vdev->migration_blocker);
vdev->migration_blocker = NULL;
next prev parent reply other threads:[~2019-11-18 18:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-18 18:46 [PULL 0/3] VFIO fixes 2019-11-18 Alex Williamson
2019-11-18 18:46 ` [PULL 1/3] hw/vfio/pci: Fix double free of migration_blocker Alex Williamson
2019-11-18 18:46 ` Alex Williamson [this message]
2019-11-18 18:47 ` [PULL 3/3] vfio: vfio-pci requires EDID Alex Williamson
2019-11-19 9:17 ` [PULL 0/3] VFIO fixes 2019-11-18 Peter Maydell
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=157410280915.24655.2269183247539766479.stgit@gimli.home \
--to=alex.williamson@redhat.com \
--cc=qemu-devel@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).