Skip to contentSkip to conversation

net/colo-compare.c: Fix a crash in COLO Primary.

PATCH Superseded Lukas Straub 2 participants 2 messages Apr 19, 2019 Networking

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/colo-compare.c: Fix a crash in COLO Primary.

From: Lukas Straub <[email protected]>
Fixes the following bug: https://bugs.launchpad.net/qemu/+bug/1824622

---
 net/colo-compare.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
net/colo-compare.c +1 -2
index bf10526f05..fcb491121b 100644
@@ -813,9 +813,8 @@ static void colo_compare_handle_event(void *opaque)
         break;
     }
 
-    assert(event_unhandled_count > 0);
-
     qemu_mutex_lock(&event_mtx);
+    assert(event_unhandled_count > 0);
     event_unhandled_count--;
     qemu_cond_broadcast(&event_complete_cond);
     qemu_mutex_unlock(&event_mtx);

--
2.20.1

#1 lore raw
Quoted 10 lines

-----Original Message-----
From: Lukas Straub [mailto:[email protected]]
Sent: Friday, April 19, 2019 9:56 PM
To: [email protected]
Cc: Zhang, Chen <[email protected]>
Subject: [PATCH] net/colo-compare.c: Fix a crash in COLO Primary.

Quoted 2 lines

From: Lukas Straub <[email protected]> Fixes the following bug:
https://bugs.launchpad.net/qemu/+bug/1824622

It looks good for me, but I think you need add more comments in commit message, For example what situation will trigger this bug and why it will occur. After that, I think you can close the bug in Launchpad.

Thanks
Zhang Chen

Quoted 23 lines
---
 net/colo-compare.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
net/colo-compare.c index renamed from net/colo-compare.c +0 -0

bf10526f05..fcb491121b 100644

net/colo-compare.c +1 -3
@@ -813,9 +813,8 @@ static void colo_compare_handle_event(void *opaque)
         break;
     }
 
-    assert(event_unhandled_count > 0);
-
     qemu_mutex_lock(&event_mtx);
+    assert(event_unhandled_count > 0);
     event_unhandled_count--;
     qemu_cond_broadcast(&event_complete_cond);
     qemu_mutex_unlock(&event_mtx);
--

2.20.1