From: Peter Krempa Date: Fri, 26 Oct 2012 12:33:13 +0000 (+0200) Subject: conf: net: Fix deadlock if assignment of network def fails X-Git-Tag: v0.10.2.2~53 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2d49ed5d18f0734e3c4461347703cc2305137e8b;p=thirdparty%2Flibvirt.git conf: net: Fix deadlock if assignment of network def fails When the assignment fails, the network object is not unlocked and next call that would use it deadlocks. (cherry picked from commit f8230891243f86e920d04a0751512cc31055ff8c) --- diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c index a7b297a6a0..a09f5fcd56 100644 --- a/src/conf/network_conf.c +++ b/src/conf/network_conf.c @@ -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;