From patchwork Wed Oct 31 15:30:37 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 195895 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id C7A0B2C0379 for ; Thu, 1 Nov 2012 02:33:02 +1100 (EST) Received: from localhost ([::1]:60343 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTaHs-0000Vd-Sv for incoming@patchwork.ozlabs.org; Wed, 31 Oct 2012 11:33:00 -0400 Received: from eggs.gnu.org ([208.118.235.92]:46563) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTaHS-0000JD-JE for qemu-devel@nongnu.org; Wed, 31 Oct 2012 11:32:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TTaHM-0005PL-8c for qemu-devel@nongnu.org; Wed, 31 Oct 2012 11:32:34 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:55215) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTaHM-0004oe-1d for qemu-devel@nongnu.org; Wed, 31 Oct 2012 11:32:28 -0400 Received: by mail-pa0-f45.google.com with SMTP id fb10so1006039pad.4 for ; Wed, 31 Oct 2012 08:32:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=a+QOwvVwlrrN1M0UUIBv+hxhfTVESaQO7teeKgF2Qi0=; b=X6twlWcG9ORaK2oqEGstxZPLiwuX5W4cG+ptWCCQ7gImSaNPqqPeOndncBgw6ke2+h 8C9LKTqYkk9buFvVMHnFcEMUtxoWIfQApE0zPErGvtVX1L6JbnOpWbdqHJhkdElZLFKQ bZsMO5sjrfUVU6VMOKZKvqtQ4miYN+ogEKY6ACQM1KhUb12Rl0gSPizfLEZ/717tHKNT 9oR6ovvxhZP3JCtd1ZC5KuJlTIAnKGs8IGGyMlcC9rj/bABXXrIBp7jM/cmCEYnWrhgX 7LzpoMwfvjGZr3fIeQiOrdppu/uZPoMAZDn41ybp6gAy0Fe5uPM73iIh+dYU/zeaIAHn bC0w== Received: by 10.68.245.169 with SMTP id xp9mr23408633pbc.142.1351697547714; Wed, 31 Oct 2012 08:32:27 -0700 (PDT) Received: from yakj.usersys.redhat.com (93-34-169-1.ip50.fastwebnet.it. [93.34.169.1]) by mx.google.com with ESMTPS id sz6sm2445230pbc.52.2012.10.31.08.32.23 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 31 Oct 2012 08:32:25 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 31 Oct 2012 16:30:37 +0100 Message-Id: <1351697456-16107-21-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.7.12.1 In-Reply-To: <1351697456-16107-1-git-send-email-pbonzini@redhat.com> References: <1351697456-16107-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.220.45 Cc: aliguori@us.ibm.com, stefanha@redhat.com Subject: [Qemu-devel] [PATCH v2 20/39] aio: test node->deleted before calling io_flush X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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; }