From patchwork Wed Oct 31 15:30:37 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [v2,20/39] aio: test node->deleted before calling io_flush Date: Wed, 31 Oct 2012 05:30:37 -0000 From: Paolo Bonzini X-Patchwork-Id: 195895 Message-Id: <1351697456-16107-21-git-send-email-pbonzini@redhat.com> To: qemu-devel@nongnu.org Cc: aliguori@us.ibm.com, stefanha@redhat.com Otherwise, there could be a case where io_flush accesses freed memory because it should not have been called. Signed-off-by: Paolo Bonzini --- aio.c | 2 +- 1 file modificato, 1 inserzione(+). 1 rimozione(-) diff --git a/aio.c b/aio.c index c89f1e9..734d2cf 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; }