mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
Do not call nodeStateCleanup on early initialization error
If we have not allocated driver yet, there is nothing to cleanup.
This commit is contained in:
parent
d85e29dd82
commit
c8afb4e1ec
@ -1709,21 +1709,21 @@ static int nodeStateInitialize(bool privileged,
|
|||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
if (VIR_ALLOC(priv) < 0)
|
if (VIR_ALLOC(priv) < 0)
|
||||||
goto out;
|
return -1;
|
||||||
|
|
||||||
priv->watch = -1;
|
priv->watch = -1;
|
||||||
priv->privileged = privileged;
|
priv->privileged = privileged;
|
||||||
|
|
||||||
if (VIR_ALLOC(driver) < 0) {
|
if (VIR_ALLOC(driver) < 0) {
|
||||||
VIR_FREE(priv);
|
VIR_FREE(priv);
|
||||||
goto out;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virMutexInit(&driver->lock) < 0) {
|
if (virMutexInit(&driver->lock) < 0) {
|
||||||
VIR_ERROR(_("Failed to initialize mutex for driver"));
|
VIR_ERROR(_("Failed to initialize mutex for driver"));
|
||||||
VIR_FREE(priv);
|
VIR_FREE(priv);
|
||||||
VIR_FREE(driver);
|
VIR_FREE(driver);
|
||||||
goto out;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
nodeDeviceLock();
|
nodeDeviceLock();
|
||||||
@ -1785,7 +1785,6 @@ static int nodeStateInitialize(bool privileged,
|
|||||||
out_unlock:
|
out_unlock:
|
||||||
nodeDeviceUnlock();
|
nodeDeviceUnlock();
|
||||||
|
|
||||||
out:
|
|
||||||
if (ret == -1)
|
if (ret == -1)
|
||||||
nodeStateCleanup();
|
nodeStateCleanup();
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user