[libvirt] [PATCH 28/32] udevSetupSystemDev: return if allocation fails

Ján Tomko jtomko at redhat.com
Mon Jun 6 09:02:05 UTC 2016


There is no cleanup to be done.
---
 src/node_device/node_device_udev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
index 1e96154..484aa5c 100644
--- a/src/node_device/node_device_udev.c
+++ b/src/node_device/node_device_udev.c
@@ -1379,8 +1379,8 @@ static int udevSetupSystemDev(void)
     virNodeDeviceObjPtr dev = NULL;
     int ret = -1;
 
-    if (VIR_ALLOC(def) != 0)
-        goto out;
+    if (VIR_ALLOC(def) < 0)
+        return -1;
 
     if (VIR_STRDUP(def->name, "computer") < 0)
         goto out;
-- 
2.7.3




More information about the libvir-list mailing list