]> git.proxmox.com Git - mirror_qemu.git/commitdiff
memory: fix address space initialization/destruction
authorAvi Kivity <avi.kivity@gmail.com>
Tue, 30 Oct 2012 11:47:44 +0000 (13:47 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 24 May 2013 16:43:25 +0000 (18:43 +0200)
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 <peter.maydell@linaro.org>
Signed-off-by: Avi Kivity <avi.kivity@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
memory.c

index 11bbeb7445f1c867c0214c1fea171700f02ee7a7..9478f98fdc42b3410330beb29d1866ef032948a9 100644 (file)
--- 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)