aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2019-11-18 21:35:48 +0000
committerPeter Maydell <peter.maydell@linaro.org>2019-11-18 21:35:48 +0000
commitf086f22d6c068ba151b0f6e81e75a64f130df712 (patch)
tree426a77a49035798bbed0465f471422eaeb4e4e4e
parenta5c2a235103ab366ad5318636ec138e52c6dcfa4 (diff)
parent29b95c992a569818294478b4616e44b45c67d34e (diff)
Merge remote-tracking branch 'remotes/awilliam/tags/vfio-fixes-20191118.0' into staging
VFIO fixes 2019-11-18 - Fix migration blocker double free (Michal Privoznik) - Use migration_add_blocker() return value (Jens Freimann) - Depend on EDID for display support (Paolo Bonzini) # gpg: Signature made Mon 18 Nov 2019 17:44:52 GMT # gpg: using RSA key 239B9B6E3BB08B22 # gpg: Good signature from "Alex Williamson <alex.williamson@redhat.com>" [full] # gpg: aka "Alex Williamson <alex@shazbot.org>" [full] # gpg: aka "Alex Williamson <alwillia@redhat.com>" [full] # gpg: aka "Alex Williamson <alex.l.williamson@gmail.com>" [full] # Primary key fingerprint: 42F6 C04E 540B D1A9 9E7B 8A90 239B 9B6E 3BB0 8B22 * remotes/awilliam/tags/vfio-fixes-20191118.0: vfio: vfio-pci requires EDID vfio: don't ignore return value of migrate_add_blocker hw/vfio/pci: Fix double free of migration_blocker Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--hw/vfio/Kconfig1
-rw-r--r--hw/vfio/pci.c4
2 files changed, 4 insertions, 1 deletions
diff --git a/hw/vfio/Kconfig b/hw/vfio/Kconfig
index 34da2a3cfd..f0eaa75ce7 100644
--- a/hw/vfio/Kconfig
+++ b/hw/vfio/Kconfig
@@ -6,6 +6,7 @@ config VFIO_PCI
bool
default y
select VFIO
+ select EDID
depends on LINUX && PCI
config VFIO_CCW
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index e6569a7968..0c55883bba 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -2737,9 +2737,10 @@ 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;
return;
}
}
@@ -3023,6 +3024,7 @@ error:
if (vdev->migration_blocker) {
migrate_del_blocker(vdev->migration_blocker);
error_free(vdev->migration_blocker);
+ vdev->migration_blocker = NULL;
}
}