libvirt/node_device-fix-leak-of-DIR.patch
Jiabo Feng 52e9a4d1d4 libvirt update to version 6.2.0-60
- vdpa: support vdpa device migrate
- vdpa: support vdpa device hot plug/unplug
- vdpa: Introduce the new device type vdpa to hostdev
- node_device: fix leak of DIR*
- Include vdpa devices in node device list
- lxc: fix lxcContainerMountAllFS() DEREF_BEFORE_CHECK
- qemu: Return perf status that affect next boot  for shutoff domains While we set up perf events for a shutoff domain and check the settings, All of perf events are reported as 'disabled', unless we add --config, This is redundant for a shutoff domain.
- tests: upstream Fixing compiler warning in cputest
- qemu_migration_cookie: Rename ret in qemuDomainExtractTLSSubject
- virrandom: Fix printf format string in virRandomGenerateWWN()
- fix the issue of errors when saving after 'virsh edit'
- Use (un)signed printf specifiers correctly
- admin: fix leak of typed parameters on error
- esx: call freeaddrinfo earlier in esxUtil_ResolveHostname Call freeaddrinfo() as soon as @result is not needed anymore, i.e. right after getnameinfo(); this avoids calling freeaddrinfo() in two branches.
- qemu: Fix incorrect command name in error messages

Signed-off-by: Jiabo Feng <fengjiabo1@huawei.com>
2023-12-05 21:06:20 +08:00

47 lines
1.6 KiB
Diff

From bbe1178cd6375270b01324dbbd4b34f17ff6ac1a Mon Sep 17 00:00:00 2001
From: AlexChen <alex.chen@huawei.com>
Date: Tue, 27 Oct 2020 21:43:47 -0400
Subject: [PATCH] node_device: fix leak of DIR*
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Commit 53aec799fa31 introduced the function udevGetVDPACharDev(),
which scans a directory using virDirOpenIfExists() and
virDirRead(). It unfortunately forgets to close the DIR* when it is
finished with it. This patch fixes that omission.
Fixes: 53aec799fa31711ffaeacc7ec17ec6d3c2e3cadf
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: AlexChen <alex.chen@huawei.com>
---
src/node_device/node_device_udev.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
index 2764315325..a5a018652b 100644
--- a/src/node_device/node_device_udev.c
+++ b/src/node_device/node_device_udev.c
@@ -1108,6 +1108,7 @@ udevGetVDPACharDev(const char *sysfs_path,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("vDPA chardev path '%s' does not exist"),
chardev);
+ VIR_DIR_CLOSE(dir);
return -1;
}
VIR_DEBUG("vDPA chardev is at '%s'", chardev);
@@ -1117,6 +1118,8 @@ udevGetVDPACharDev(const char *sysfs_path,
}
}
+ VIR_DIR_CLOSE(dir);
+
if (direrr < 0)
return -1;
--
2.27.0