Blame SOURCES/kvm-vfio-pci-Fix-failure-to-close-file-descriptor-on-err.patch

7711c0
From da8839a4373667b017e935d7c365af6cbfd97bb9 Mon Sep 17 00:00:00 2001
7711c0
From: Alex Williamson <alex.williamson@redhat.com>
7711c0
Date: Mon, 3 Dec 2018 21:54:02 +0100
7711c0
Subject: [PATCH 23/34] vfio/pci: Fix failure to close file descriptor on error
7711c0
7711c0
RH-Author: Alex Williamson <alex.williamson@redhat.com>
7711c0
Message-id: <154387404228.26945.9774510369852793346.stgit@gimli.home>
7711c0
Patchwork-id: 83232
7711c0
O-Subject: [RHEL-7.7 qemu-kvm-rhev PATCH 6/7] vfio/pci: Fix failure to close file descriptor on error
7711c0
Bugzilla: 1619778
7711c0
RH-Acked-by: Peter Xu <peterx@redhat.com>
7711c0
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
7711c0
RH-Acked-by: Auger Eric <eric.auger@redhat.com>
7711c0
RH-Acked-by: David Hildenbrand <david@redhat.com>
7711c0
7711c0
Bugzilla: 1619778
7711c0
7711c0
A new error path fails to close the device file descriptor when
7711c0
triggered by a ballooning incompatibility within the group.  Fix it.
7711c0
7711c0
Fixes: 238e91728503 ("vfio/ccw/pci: Allow devices to opt-in for ballooning")
7711c0
Reviewed-by: Peter Xu <peterx@redhat.com>
7711c0
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
7711c0
(cherry picked from commit 8709b3954d4161bad30ccc435408ec50e10f53cc)
7711c0
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
7711c0
---
7711c0
 hw/vfio/common.c | 1 +
7711c0
 1 file changed, 1 insertion(+)
7711c0
7711c0
diff --git a/hw/vfio/common.c b/hw/vfio/common.c
7711c0
index cda2d1f..3ab92bd 100644
7711c0
--- a/hw/vfio/common.c
7711c0
+++ b/hw/vfio/common.c
7711c0
@@ -1424,6 +1424,7 @@ int vfio_get_device(VFIOGroup *group, const char *name,
7711c0
         if (!QLIST_EMPTY(&group->device_list)) {
7711c0
             error_setg(errp,
7711c0
                        "Inconsistent device balloon setting within group");
7711c0
+            close(fd);
7711c0
             return -1;
7711c0
         }
7711c0
 
7711c0
-- 
7711c0
1.8.3.1
7711c0