From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:40729) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTAIj-00088F-IR for qemu-devel@nongnu.org; Tue, 30 Oct 2012 07:48:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TTAId-0003tn-LU for qemu-devel@nongnu.org; Tue, 30 Oct 2012 07:48:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:64992) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TTAId-0003tX-DY for qemu-devel@nongnu.org; Tue, 30 Oct 2012 07:48:03 -0400 From: Avi Kivity Date: Tue, 30 Oct 2012 13:47:44 +0200 Message-Id: <1351597670-23031-2-git-send-email-avi@redhat.com> In-Reply-To: <1351597670-23031-1-git-send-email-avi@redhat.com> References: <1351597670-23031-1-git-send-email-avi@redhat.com> Subject: [Qemu-devel] [PATCH v2 1/7] memory: fix address space initialization/destruction List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , Alexander Graf , Blue Swirl , Alex Williamson , Anthony Liguori 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 243cb23..ae3552b 100644 --- a/memory.c +++ b/memory.c @@ -1541,6 +1541,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(); @@ -1557,6 +1559,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.7.12