diff options
author | Alex Williamson <alex.williamson@redhat.com> | 2018-08-23 10:45:58 -0600 |
---|---|---|
committer | Alex Williamson <alex.williamson@redhat.com> | 2018-08-23 10:45:58 -0600 |
commit | 8709b3954d4161bad30ccc435408ec50e10f53cc (patch) | |
tree | bb4a7963d81f4b23a4189903e1b704a0efdd5b4f /hw/vfio | |
parent | a1c0f886496cfb4c336f8eb4155ed424567d653e (diff) |
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.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/vfio/common.c b/hw/vfio/common.c index 3f31f80b12..7c185e5a2e 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; } |