All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] iothread: check iothread->ctx before aio_context_unref to avoid assertion
@ 2016-09-26  5:29 Lin Ma
  2016-09-26  7:06 ` Paolo Bonzini
  2016-09-26 14:25 ` Stefan Hajnoczi
  0 siblings, 2 replies; 3+ messages in thread
From: Lin Ma @ 2016-09-26  5:29 UTC (permalink / raw)
  To: qemu-devel; +Cc: famz, pbonzini, stefanha

if iothread->ctx is set to NULL, aio_context_unref triggers the assertion:
g_source_unref: assertion 'source != NULL' failed.
The patch fixes it.

Signed-off-by: Lin Ma <lma@suse.com>
---
 iothread.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/iothread.c b/iothread.c
index fb08a60..fbeb8de 100644
--- a/iothread.c
+++ b/iothread.c
@@ -75,6 +75,9 @@ static void iothread_instance_finalize(Object *obj)
     iothread_stop(obj, NULL);
     qemu_cond_destroy(&iothread->init_done_cond);
     qemu_mutex_destroy(&iothread->init_done_lock);
+    if (!iothread->ctx) {
+        return;
+    }
     aio_context_unref(iothread->ctx);
 }
 
-- 
2.9.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-09-26 14:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-26  5:29 [Qemu-devel] [PATCH] iothread: check iothread->ctx before aio_context_unref to avoid assertion Lin Ma
2016-09-26  7:06 ` Paolo Bonzini
2016-09-26 14:25 ` Stefan Hajnoczi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.