From 47db50baa0d2d122151e634bae10f9b97fd55daf Mon Sep 17 00:00:00 2001 Message-Id: <47db50baa0d2d122151e634bae10f9b97fd55daf.1427300678.git.jen@redhat.com> In-Reply-To: References: From: Vlad Yasevich Date: Thu, 12 Mar 2015 19:13:05 -0500 Subject: [CHANGE 09/33] aio: test node->deleted before calling io_flush To: rhvirt-patches@redhat.com, jen@redhat.com RH-Author: Vlad Yasevich Message-id: <1426187601-21396-10-git-send-email-vyasevic@redhat.com> Patchwork-id: 64345 O-Subject: [RHEL6.7 qemu-kvm PATCH v2 09/25] aio: test node->deleted before calling io_flush Bugzilla: 1005016 RH-Acked-by: Michael S. Tsirkin RH-Acked-by: Juan Quintela RH-Acked-by: Paolo Bonzini From: Paolo Bonzini Otherwise, there could be a case where io_flush accesses freed memory because it should not have been called. Signed-off-by: Paolo Bonzini (cherry picked from commit 4231c88d27d9e46e6ad6e6b7bbb6e442bcf9cd05) Signed-off-by: Jeff E. Nelson Conflicts: aio.c - Minor conflict due to older code. Signed-off-by: Vladislav Yasevich --- aio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Signed-off-by: Jeff E. Nelson --- aio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aio.c b/aio.c index 91302f9..a258f87 100644 --- a/aio.c +++ b/aio.c @@ -111,7 +111,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; } -- 2.1.0