[PATCH 1/2] virmacmap: Fix variable handling

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

 



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@xxxxxxxxxx>
---
 src/util/virmacmap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/util/virmacmap.c b/src/util/virmacmap.c
index 36c364e10..11b3e0334 100644
--- a/src/util/virmacmap.c
+++ b/src/util/virmacmap.c
@@ -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 &&
-- 
2.11.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux