From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:56417) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TMIrE-00037Y-QV for qemu-devel@nongnu.org; Thu, 11 Oct 2012 09:31:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TMIrD-0001YG-Ht for qemu-devel@nongnu.org; Thu, 11 Oct 2012 09:31:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:22540) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TMIrD-0001Xt-9C for qemu-devel@nongnu.org; Thu, 11 Oct 2012 09:31:23 -0400 Message-ID: <5076CA24.90604@redhat.com> Date: Thu, 11 Oct 2012 15:31:16 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1349962023-560-1-git-send-email-avi@redhat.com> <1349962023-560-2-git-send-email-avi@redhat.com> In-Reply-To: <1349962023-560-2-git-send-email-avi@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC v1 1/7] memory: fix address space initialization/destruction List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: "Michael S. Tsirkin" , liu ping fan , qemu-devel@nongnu.org, Blue Swirl , Alex Williamson , Anthony Liguori Il 11/10/2012 15:26, Avi Kivity ha scritto: > 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. Patch is obvious, but there are at least two alternatives: 1) using memset 2) using a compound initializer. Paolo > Signed-off-by: Avi Kivity > --- > memory.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/memory.c b/memory.c > index 2f68d67..5df6177 100644 > --- a/memory.c > +++ b/memory.c > @@ -1538,6 +1538,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(); > @@ -1554,6 +1556,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, target_phys_addr_t addr, unsigned size) >