From 4c19eb721a5929f2277d33a98bb59963c58c2e3b Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Tue, 30 Oct 2012 13:47:44 +0200 Subject: memory: fix address space initialization/destruction 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(+) (limited to 'memory.c') 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) -- cgit v1.1