[Pkg-libvirt-commits] [SCM] Libvirt Debian packaging branch, master, updated. debian/0.8.1-2
Guido Günther
agx at sigxcpu.org
Mon Jun 7 18:05:35 UTC 2010
The following commit has been merged in the master branch:
commit bba6d72d555721b36daf1fb0f7f3d8c7fefe6449
Author: Guido Günther <agx at sigxcpu.org>
Date: Mon Jun 7 18:22:34 2010 +0200
New patch 0008-Fix-leaks-in-udev-device-add-remove.patch
Fix leaks in udev device add/remove.
Closes: #582965
Thanks: Nigel Jones for forwarding this
diff --git a/debian/patches/0008-Fix-leaks-in-udev-device-add-remove.patch b/debian/patches/0008-Fix-leaks-in-udev-device-add-remove.patch
new file mode 100644
index 0000000..a5821f8
--- /dev/null
+++ b/debian/patches/0008-Fix-leaks-in-udev-device-add-remove.patch
@@ -0,0 +1,63 @@
+From: =?UTF-8?q?Guido=20G=C3=BCnther?= <agx at sigxcpu.org>
+Date: Mon, 7 Jun 2010 18:20:04 +0200
+Subject: [PATCH] Fix leaks in udev device add/remove
+
+Patch pulled from upstream git.
+
+Closes: #582965
+Thanks: Nigel Jones for forwarding
+---
+ src/node_device/node_device_udev.c | 12 ++++++++++--
+ 1 files changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
+index bcfe991..1cf7fa7 100644
+--- a/src/node_device/node_device_udev.c
++++ b/src/node_device/node_device_udev.c
+@@ -1195,6 +1195,8 @@ static int udevRemoveOneDevice(struct udev_device *device)
+ }
+ nodeDeviceUnlock(driverState);
+
++ udev_device_unref(device);
++
+ return ret;
+ }
+
+@@ -1281,13 +1283,14 @@ static int udevAddOneDevice(struct udev_device *device)
+ goto out;
+ }
+
++ /* If this is a device change, the old definition will be freed
++ * and the current definition will take its place. */
+ nodeDeviceLock(driverState);
+ dev = virNodeDeviceAssignDef(&driverState->devs, def);
+ nodeDeviceUnlock(driverState);
+
+ if (dev == NULL) {
+ VIR_ERROR("Failed to create device for '%s'", def->name);
+- virNodeDeviceDefFree(def);
+ goto out;
+ }
+
+@@ -1296,6 +1299,12 @@ static int udevAddOneDevice(struct udev_device *device)
+ ret = 0;
+
+ out:
++ if (ret != 0) {
++ virNodeDeviceDefFree(def);
++ }
++
++ udev_device_unref(device);
++
+ return ret;
+ }
+
+@@ -1315,7 +1324,6 @@ static int udevProcessDeviceListEntry(struct udev *udev,
+ VIR_INFO("Failed to create node device for udev device '%s'",
+ name);
+ }
+- udev_device_unref(device);
+ ret = 0;
+ }
+
+--
diff --git a/debian/patches/series b/debian/patches/series
index 2706feb..7ea249d 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -5,3 +5,4 @@
0005-Terminate-nc-on-EOF.patch
0006-Don-t-drop-caps-when-exec-ing-qemu.patch
0007-patch-qemuMonitorTextGetMigrationStatus-to-intercept.patch
+0008-Fix-leaks-in-udev-device-add-remove.patch
--
Libvirt Debian packaging
More information about the Pkg-libvirt-commits
mailing list