]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
udevSetupSystemDev: return if allocation fails
authorJán Tomko <jtomko@redhat.com>
Fri, 3 Jun 2016 17:42:11 +0000 (19:42 +0200)
committerJán Tomko <jtomko@redhat.com>
Tue, 7 Jun 2016 10:53:37 +0000 (12:53 +0200)
There is no cleanup to be done.

src/node_device/node_device_udev.c

index 8b06ea8242d38877961d9d002350c05b789ed12b..ebdd4089a7b0b0169201d4ff2e6d2d3093d18226 100644 (file)
@@ -1384,8 +1384,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;