diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c index 8b06ea8242d38877961d9d002350c05b789ed12b..ebdd4089a7b0b0169201d4ff2e6d2d3093d18226 100644 --- a/src/node_device/node_device_udev.c +++ b/src/node_device/node_device_udev.c @@ -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;