]> xenbits.xensource.com Git - 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)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 2 Nov 2012 12:28:39 +0000 (13:28 +0100)
When the assignment fails, the network object is not unlocked and next
call that would use it deadlocks.

src/conf/network_conf.c

index d16b705928525531c96402ecf945ae6484c990d7..7bd7ba9db2951dabc56225a7e6375ef9e790f42e 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;