From patchwork Thu Oct 11 13:26:57 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avi Kivity X-Patchwork-Id: 190910 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 5FCC32C0089 for ; Fri, 12 Oct 2012 00:28:31 +1100 (EST) Received: from localhost ([::1]:52821 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TMIoP-0000pV-GE for incoming@patchwork.ozlabs.org; Thu, 11 Oct 2012 09:28:29 -0400 Received: from eggs.gnu.org ([208.118.235.92]:34856) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TMInS-0006rp-RV for qemu-devel@nongnu.org; Thu, 11 Oct 2012 09:27:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TMInF-0008QU-Cv for qemu-devel@nongnu.org; Thu, 11 Oct 2012 09:27:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:21375) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TMInF-0008QN-5G for qemu-devel@nongnu.org; Thu, 11 Oct 2012 09:27:17 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q9BDREuS003001 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 11 Oct 2012 09:27:14 -0400 Received: from s01.tlv.redhat.com (s01.tlv.redhat.com [10.35.255.8]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q9BDR72m003602; Thu, 11 Oct 2012 09:27:11 -0400 From: Avi Kivity To: qemu-devel@nongnu.org, Blue Swirl , Anthony Liguori , "Michael S. Tsirkin" , Alex Williamson , liu ping fan , Paolo Bonzini Date: Thu, 11 Oct 2012 15:26:57 +0200 Message-Id: <1349962023-560-2-git-send-email-avi@redhat.com> In-Reply-To: <1349962023-560-1-git-send-email-avi@redhat.com> References: <1349962023-560-1-git-send-email-avi@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [RFC v1 1/7] 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 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. Signed-off-by: Avi Kivity --- memory.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/memory.c b/memory.c index 2f68d67..5df6177 100644 --- a/memory.c +++ b/memory.c @@ -1538,6 +1538,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(); @@ -1554,6 +1556,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, target_phys_addr_t addr, unsigned size)