]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
conf: net: Fix deadlock if assignment of network def fails
authorPeter Krempa <pkrempa@redhat.com>
Fri, 26 Oct 2012 12:33:13 +0000 (14:33 +0200)
committerCole Robinson <crobinso@redhat.com>
Sun, 9 Dec 2012 21:20:57 +0000 (16:20 -0500)
When the assignment fails, the network object is not unlocked and next
call that would use it deadlocks.
(cherry picked from commit f8230891243f86e920d04a0751512cc31055ff8c)

src/conf/network_conf.c

index a7b297a6a08b8805a2140532be4ac5bb55f34dea..a09f5fcd568e0a1c2c3ad0c8148b76149f2150f3 100644 (file)
@@ -295,6 +295,7 @@ virNetworkAssignDef(virNetworkObjListPtr nets,
 
     if ((network = virNetworkFindByName(nets, def->name))) {
         if (virNetworkObjAssignDef(network, def, live) < 0) {
+            virNetworkObjUnlock(network);
             return NULL;
         }
         return network;