diff options
author | Lin Ma | 2016-09-26 07:29:58 +0200 |
---|---|---|
committer | Stefan Hajnoczi | 2016-09-28 12:21:46 +0200 |
commit | eb7b5c35117bfb90dcfa881a0e3b23368c73fba6 (patch) | |
tree | 6fccee369c1796dc7f564cc292a5e5974ed930b0 | |
parent | aio-posix: avoid unnecessary aio_epoll_enabled() calls (diff) | |
download | qemu-eb7b5c35117bfb90dcfa881a0e3b23368c73fba6.tar.gz qemu-eb7b5c35117bfb90dcfa881a0e3b23368c73fba6.tar.xz qemu-eb7b5c35117bfb90dcfa881a0e3b23368c73fba6.zip |
iothread: check iothread->ctx before aio_context_unref to avoid assertion
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>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 20160926052958.10716-1-lma@suse.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
-rw-r--r-- | iothread.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/iothread.c b/iothread.c index fb08a60b4b..fbeb8deb38 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); } |