[PATCH 1/5] nodedev: Unlock @priv if initialization of mdevctlMonitors fails

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 src/node_device/node_device_udev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
index 7d4e8f5c0b..04e1094e21 100644
--- a/src/node_device/node_device_udev.c
+++ b/src/node_device/node_device_udev.c
@@ -2274,7 +2274,7 @@ nodeStateInitialize(bool privileged,
     if (!(priv->mdevctlMonitors = monitorFileRecursively(priv,
                                                          mdevctlConfigDir))) {
         virMutexUnlock(&priv->mdevctlLock);
-        goto cleanup;
+        goto unlock;
     }
     virMutexUnlock(&priv->mdevctlLock);
 
-- 
2.26.3




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux