From 2d49ed5d18f0734e3c4461347703cc2305137e8b Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Fri, 26 Oct 2012 14:33:13 +0200 Subject: [PATCH] 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) --- src/conf/network_conf.c | 1 + 1 file changed, 1 insertion(+) 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;