From mboxrd@z Thu Jan 1 00:00:00 1970 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) Sender: Paolo Bonzini From: Paolo Bonzini Date: Fri, 24 May 2013 19:03:03 +0200 Message-Id: <1369414987-8839-12-git-send-email-pbonzini@redhat.com> In-Reply-To: <1369414987-8839-1-git-send-email-pbonzini@redhat.com> References: <1369414987-8839-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 11/15] memory: fix address space initialization/destruction List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Avi Kivity 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) -- 1.8.1.4