]> xenbits.xensource.com Git - libvirt.git/commitdiff
virmacmap: Fix variable handling
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 2 Jan 2017 08:50:24 +0000 (09:50 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 2 Jan 2017 12:05:34 +0000 (13:05 +0100)
In virMacMapRemoveLocked() we have two variables: @macsList and
@newMacsList. Obviously, @newMacsList is supposed to hold pointer
to modified list but in fact it holds pointer to the old list.
It's confusing.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/util/virmacmap.c

index 36c364e100d773225a01bef9d6fa359a4ba862cd..11b3e0334618d7e973f43e46809c2ebba62babf3 100644 (file)
@@ -121,8 +121,8 @@ virMacMapRemoveLocked(virMacMapPtr mgr,
         return 0;
 
     newMacsList = macsList;
-    virStringListRemove(&macsList, mac);
-    if (!macsList) {
+    virStringListRemove(&newMacsList, mac);
+    if (!newMacsList) {
         virHashSteal(mgr->macs, domain);
     } else {
         if (macsList != newMacsList &&