提交 c8afb4e1 编写于 作者: J Ján Tomko

Do not call nodeStateCleanup on early initialization error

If we have not allocated driver yet, there is nothing to cleanup.
上级 d85e29dd
......@@ -1709,21 +1709,21 @@ static int nodeStateInitialize(bool privileged,
int ret = -1;
if (VIR_ALLOC(priv) < 0)
goto out;
return -1;
priv->watch = -1;
priv->privileged = privileged;
if (VIR_ALLOC(driver) < 0) {
VIR_FREE(priv);
goto out;
return -1;
}
if (virMutexInit(&driver->lock) < 0) {
VIR_ERROR(_("Failed to initialize mutex for driver"));
VIR_FREE(priv);
VIR_FREE(driver);
goto out;
return -1;
}
nodeDeviceLock();
......@@ -1785,7 +1785,6 @@ static int nodeStateInitialize(bool privileged,
out_unlock:
nodeDeviceUnlock();
out:
if (ret == -1)
nodeStateCleanup();
return ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册