If initialization of priv->mdevctlMonitors fails, then the
control jumps over to cleanup label where nodeStateCleanup() is
called which tries to lock @priv. But since @priv was already
locked before taking the jump a deadlock occurs. The solution is
to jump onto @unlock label, just like the code around is doing.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
if (!(priv->mdevctlMonitors = monitorFileRecursively(priv,
mdevctlConfigDir))) {
virMutexUnlock(&priv->mdevctlLock);
- goto cleanup;
+ goto unlock;
}
virMutexUnlock(&priv->mdevctlLock);