From: Paolo Bonzini Date: Wed, 26 Sep 2012 13:21:36 +0000 (+0200) Subject: aio: test node->deleted before calling io_flush X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=4231c88d27d9e46e6ad6e6b7bbb6e442bcf9cd05;p=qemu.git aio: test node->deleted before calling io_flush Otherwise, there could be a case where io_flush accesses freed memory because it should not have been called. Signed-off-by: Paolo Bonzini --- diff --git a/aio.c b/aio.c index c89f1e95c1..734d2cfa0b 100644 --- a/aio.c +++ b/aio.c @@ -122,7 +122,7 @@ bool aio_wait(AioContext *ctx) * Otherwise, if there are no AIO requests, qemu_aio_wait() would * wait indefinitely. */ - if (node->io_flush) { + if (!node->deleted && node->io_flush) { if (node->io_flush(node->opaque) == 0) { continue; }