mirror of https://gitee.com/openkylin/libvirt.git
Reformat nodeStateCleanup
Remove the ret variable and return early if there is no driver.
This commit is contained in:
parent
5c88b34afa
commit
d85e29dd82
|
@ -1488,13 +1488,13 @@ static void udevPCITranslateDeinit(void)
|
||||||
|
|
||||||
static int nodeStateCleanup(void)
|
static int nodeStateCleanup(void)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
|
||||||
|
|
||||||
udevPrivate *priv = NULL;
|
udevPrivate *priv = NULL;
|
||||||
struct udev_monitor *udev_monitor = NULL;
|
struct udev_monitor *udev_monitor = NULL;
|
||||||
struct udev *udev = NULL;
|
struct udev *udev = NULL;
|
||||||
|
|
||||||
if (driver) {
|
if (!driver)
|
||||||
|
return -1;
|
||||||
|
|
||||||
nodeDeviceLock();
|
nodeDeviceLock();
|
||||||
|
|
||||||
priv = driver->privateData;
|
priv = driver->privateData;
|
||||||
|
@ -1519,11 +1519,7 @@ static int nodeStateCleanup(void)
|
||||||
VIR_FREE(priv);
|
VIR_FREE(priv);
|
||||||
|
|
||||||
udevPCITranslateDeinit();
|
udevPCITranslateDeinit();
|
||||||
} else {
|
return 0;
|
||||||
ret = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue