From patchwork Tue May 21 10:57:12 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 245269 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id C4D3E2C00A2 for ; Tue, 21 May 2013 21:00:23 +1000 (EST) Received: from localhost ([::1]:41977 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UekIn-0007SS-LX for incoming@patchwork.ozlabs.org; Tue, 21 May 2013 07:00:21 -0400 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=Q8CDXF2sBk70hD0v0HJ79e4H9rdQoaCCJAZKWBL3ESc=; b=nAb9G9M9No98hjpCWj0mzUSAQriSN6jVpZHewMtlnQ1mItkvnA8F2h+ik8yKHefEBF 7nco81uMuoX7rsNpk4sXX2FAUgS9vY1rI77r89+UNiQ96zSNwkVuH1e7ncpkX7VQ1nPc GIr+fEOeJvZTdeff8EkMavW/fjyGKw3Umw5gmr80p0ILAv0Dg4eCq2Gikkxs49udzg3b ZxVmRvR1ITGkBBUXbgvsv5iPzGlIAurnRDa5KB81Kv6EiglVCfpoBvVA5cY4Zr/pAI7g vL65KcPbDYtQUy8uI0srlgGbZ/OK+ZYrpcbRNLxkAfGS/10mIFCaSU7mU1mMGZeAG74u 1S5w== X-Received: by 10.15.22.135 with SMTP id f7mr5174929eeu.29.1369133882013; Tue, 21 May 2013 03:58:02 -0700 (PDT) Received: from playground.lan (net-37-116-223-193.cust.dsl.vodafone.it. [37.116.223.193]) by mx.google.com with ESMTPSA id a5sm2754398ees.6.2013.05.21.03.58.00 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 21 May 2013 03:58:01 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 21 May 2013 12:57:12 +0200 Message-Id: <1369133851-1894-12-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1369133851-1894-1-git-send-email-pbonzini@redhat.com> References: <1369133851-1894-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 74.125.83.47 Cc: peter.maydell@linaro.org, jan.kiszka@gmail.com, Avi Kivity , David Gibson Subject: [Qemu-devel] [PATCH 11/30] memory: fix address space initialization/destruction X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 Reviewed-by: Peter Maydell --- 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)