From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:44926) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UekGa-0004C3-Pf for qemu-devel@nongnu.org; Tue, 21 May 2013 06:58:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UekGZ-00053f-5R for qemu-devel@nongnu.org; Tue, 21 May 2013 06:58:04 -0400 Received: from mail-ee0-f47.google.com ([74.125.83.47]:49010) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UekGY-00053X-UA for qemu-devel@nongnu.org; Tue, 21 May 2013 06:58:03 -0400 Received: by mail-ee0-f47.google.com with SMTP id t10so300061eei.20 for ; Tue, 21 May 2013 03:58:02 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Tue, 21 May 2013 12:57:12 +0200 Message-Id: <1369133851-1894-12-git-send-email-pbonzini@redhat.com> In-Reply-To: <1369133851-1894-1-git-send-email-pbonzini@redhat.com> References: <1369133851-1894-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 11/30] memory: fix address space initialization/destruction List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, jan.kiszka@gmail.com, Avi Kivity , David Gibson 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. 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