From patchwork Fri May 24 17:03:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 246209 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 7D1D82C0079 for ; Sat, 25 May 2013 03:06:17 +1000 (EST) Received: from localhost ([::1]:55775 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UfvRX-0005Og-KQ for incoming@patchwork.ozlabs.org; Fri, 24 May 2013 13:06:15 -0400 Received: from eggs.gnu.org ([208.118.235.92]:44937) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UfvP7-0002Ee-AC for qemu-devel@nongnu.org; Fri, 24 May 2013 13:03:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UfvP0-00016k-Mc for qemu-devel@nongnu.org; Fri, 24 May 2013 13:03:45 -0400 Received: from mail-ee0-f42.google.com ([74.125.83.42]:50183) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UfvP0-00016Y-Ga for qemu-devel@nongnu.org; Fri, 24 May 2013 13:03:38 -0400 Received: by mail-ee0-f42.google.com with SMTP id c50so2863047eek.29 for ; Fri, 24 May 2013 10:03:37 -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=0ylO6TrigKXTQ39Ql4BRxE2iijm2IT4mk9lOrEdZSf8=; b=XteUrHHumnop4v7vIQTYbyRTL4AK/Ie4K4c6aXcEafR01HTCxZXK6HkcuuNZX7RQhB TF51sxJTKSVRnLE2whTdTpmzyd4Ox7U2HHcsFXnqQOmrB6UKf3BEEVNSrOn1qDzXpGjH dAbpdY82luTI5iuId0CMHHBTLc2rNIZ/I+2SP9kFZ7g1EmPFWdvXxklvP5hseIGh31Xd OLHM7DTw9DPYDGgOLVTrkrVf/i33sAAyFBs6VhQ+BfOPrLw+gBjw82tEPvczYzh2u41P lech7DEJgLEi01qW7bSbCdYB+x8PbE8mE3hZ2OKxwUKxT1gAzw7cnJW9A2q09+fAfzFW tCbw== X-Received: by 10.14.32.8 with SMTP id n8mr561317eea.98.1369415017752; Fri, 24 May 2013 10:03:37 -0700 (PDT) Received: from playground.lan (net-37-117-138-128.cust.dsl.vodafone.it. [37.117.138.128]) by mx.google.com with ESMTPSA id z52sm24872219eea.1.2013.05.24.10.03.35 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 24 May 2013 10:03:36 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 24 May 2013 19:03:03 +0200 Message-Id: <1369414987-8839-12-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1369414987-8839-1-git-send-email-pbonzini@redhat.com> References: <1369414987-8839-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 74.125.83.42 Cc: Avi Kivity Subject: [Qemu-devel] [PATCH 11/15] memory: fix address space initialization/destruction 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 From: Avi Kivity A couple of fields were left uninitialized. This was not observed earlier because all address spaces were statically allocated. Also free allocation for those fields. Reviewed-by: Peter Maydell Signed-off-by: Avi Kivity Signed-off-by: Paolo Bonzini --- memory.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/memory.c b/memory.c index 11bbeb7..9478f98 100644 --- a/memory.c +++ b/memory.c @@ -1572,6 +1572,8 @@ void address_space_init(AddressSpace *as, MemoryRegion *root) as->root = root; as->current_map = g_new(FlatView, 1); flatview_init(as->current_map); + as->ioeventfd_nb = 0; + as->ioeventfds = NULL; QTAILQ_INSERT_TAIL(&address_spaces, as, address_spaces_link); as->name = NULL; memory_region_transaction_commit(); @@ -1588,6 +1590,7 @@ void address_space_destroy(AddressSpace *as) address_space_destroy_dispatch(as); flatview_destroy(as->current_map); g_free(as->current_map); + g_free(as->ioeventfds); } uint64_t io_mem_read(MemoryRegion *mr, hwaddr addr, unsigned size)