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

[libvirt] [PATCH v2 05/20] network: Unconditionally initialize macmap when stopping virtual network



Since we can only ever have one reference to obj->macmap, rather
than only clearing obj->macmap during virNetworkObjUnrefMacMap
(e.g. virtual network from networkShutdownNetwork), let's just
unconditionally clear the obj->macmap to ensure that some future
change that created it's own reference to obj->macmap wouldn't
have that reference disappear if virNetworkObjDispose got called.

Signed-off-by: John Ferlan <jferlan redhat com>
---
 src/conf/virnetworkobj.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/conf/virnetworkobj.c b/src/conf/virnetworkobj.c
index 5578ac3..bb7225c 100644
--- a/src/conf/virnetworkobj.c
+++ b/src/conf/virnetworkobj.c
@@ -125,8 +125,8 @@ virNetworkObjSetMacMap(virNetworkObjPtr obj,
 void
 virNetworkObjUnrefMacMap(virNetworkObjPtr obj)
 {
-    if (!virObjectUnref(obj->macmap))
-        obj->macmap = NULL;
+    virObjectUnref(obj->macmap);
+    obj->macmap = NULL;
 }
 
 
-- 
2.9.4


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