提交 eb7b5c35 编写于 作者: L Lin Ma 提交者: Stefan Hajnoczi

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: NLin Ma <lma@suse.com>
Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
Message-id: 20160926052958.10716-1-lma@suse.com
Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
上级 6b942468
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册