40 lines
1.3 KiB
Diff
40 lines
1.3 KiB
Diff
From 27cb1a66b291d3493c12a8ebc90c28f7b1fe67b0 Mon Sep 17 00:00:00 2001
|
|
From: Adttil <2429917001@qq.com>
|
|
Date: Sat, 23 Nov 2024 18:15:26 +0800
|
|
Subject: [PATCH 2/2] Revert "node_device: fix leak of DIR*"
|
|
|
|
This reverts commit 3cd86072fd6725178b669174eb99ab24a0bcee6c.
|
|
Updating the dir variable in the udevGetVDPACharDev function
|
|
to a smart pointer fixed a bug where dir was not freeing,
|
|
but a previous incorrect commit resulted in a double free
|
|
of the pointer, and the patch is now rolled back
|
|
---
|
|
src/node_device/node_device_udev.c | 4 ----
|
|
1 file changed, 4 deletions(-)
|
|
|
|
diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
|
|
index aa2781db34..6c5b788279 100644
|
|
--- a/src/node_device/node_device_udev.c
|
|
+++ b/src/node_device/node_device_udev.c
|
|
@@ -1198,7 +1198,6 @@ udevGetVDPACharDev(const char *sysfs_path,
|
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
|
_("vDPA chardev path '%1$s' does not exist"),
|
|
chardev);
|
|
- virDirClose(dir);
|
|
return -1;
|
|
}
|
|
VIR_DEBUG("vDPA chardev is at '%s'", chardev);
|
|
@@ -1207,9 +1206,6 @@ udevGetVDPACharDev(const char *sysfs_path,
|
|
break;
|
|
}
|
|
}
|
|
-
|
|
- virDirClose(dir);
|
|
-
|
|
if (direrr < 0)
|
|
return -1;
|
|
|
|
--
|
|
2.43.0
|
|
|