qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

main-loop: check return value before using pointer

pointer 'qemu_aio_context' should be checked first before it is used.
qemu_bh_new() will use it.

Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
Message-Id: <1467799740-26079-2-git-send-email-caoj.fnst@cn.fujitsu.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

authored by

Cao jin and committed by
Paolo Bonzini
28ba61e7 540aecd0

+1 -1
+1 -1
main-loop.c
··· 154 154 } 155 155 156 156 qemu_aio_context = aio_context_new(&local_error); 157 - qemu_notify_bh = qemu_bh_new(notify_event_cb, NULL); 158 157 if (!qemu_aio_context) { 159 158 error_propagate(errp, local_error); 160 159 return -EMFILE; 161 160 } 161 + qemu_notify_bh = qemu_bh_new(notify_event_cb, NULL); 162 162 gpollfds = g_array_new(FALSE, FALSE, sizeof(GPollFD)); 163 163 src = aio_get_g_source(qemu_aio_context); 164 164 g_source_attach(src, NULL);