aboutsummaryrefslogtreecommitdiff
path: root/hw/vfio
diff options
context:
space:
mode:
authorAlex Williamson <alex.williamson@redhat.com>2018-08-23 10:45:58 -0600
committerAlex Williamson <alex.williamson@redhat.com>2018-08-23 10:45:58 -0600
commit8709b3954d4161bad30ccc435408ec50e10f53cc (patch)
treebb4a7963d81f4b23a4189903e1b704a0efdd5b4f /hw/vfio
parenta1c0f886496cfb4c336f8eb4155ed424567d653e (diff)
downloadqemu-8709b3954d4161bad30ccc435408ec50e10f53cc.zip
qemu-8709b3954d4161bad30ccc435408ec50e10f53cc.tar.gz
qemu-8709b3954d4161bad30ccc435408ec50e10f53cc.tar.bz2
vfio/pci: Fix failure to close file descriptor on error
A new error path fails to close the device file descriptor when triggered by a ballooning incompatibility within the group. Fix it. Fixes: 238e91728503 ("vfio/ccw/pci: Allow devices to opt-in for ballooning") Reviewed-by: Peter Xu <peterx@redhat.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'hw/vfio')
-rw-r--r--hw/vfio/common.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/vfio/common.c b/hw/vfio/common.c
index 3f31f80..7c185e5a 100644
--- a/hw/vfio/common.c
+++ b/hw/vfio/common.c
@@ -1432,6 +1432,7 @@ int vfio_get_device(VFIOGroup *group, const char *name,
if (!QLIST_EMPTY(&group->device_list)) {
error_setg(errp,
"Inconsistent device balloon setting within group");
+ close(fd);
return -1;
}