From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46511) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGlJU-0005BK-J9 for qemu-devel@nongnu.org; Fri, 21 Feb 2014 03:18:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WGlJI-0001T1-TT for qemu-devel@nongnu.org; Fri, 21 Feb 2014 03:18:28 -0500 Received: from e7.ny.us.ibm.com ([32.97.182.137]:44956) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGlJI-0001Sn-No for qemu-devel@nongnu.org; Fri, 21 Feb 2014 03:18:16 -0500 Received: from /spool/local by e7.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 21 Feb 2014 03:18:16 -0500 From: Michael Roth Date: Fri, 21 Feb 2014 02:16:52 -0600 Message-Id: <1392970647-21528-17-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: <1392970647-21528-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1392970647-21528-1-git-send-email-mdroth@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 16/51] memory.c: bugfix - ref counting mismatch in memory_region_find List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: lersek@redhat.com, qemu-stable@nongnu.org, Petar.Jovanovic@imgtec.com From: Marcel Apfelbaum 'address_space_get_flatview' gets a reference to a FlatView. If the flatview lookup fails, the code returns without "unreferencing" the view. Cc: qemu-stable@nongnu.org Signed-off-by: Marcel Apfelbaum Reviewed-by: Paolo Bonzini Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin (cherry picked from commit 6307d974f9a28bb6652352f52da97f820427d29d) Signed-off-by: Michael Roth --- memory.c | 1 + 1 file changed, 1 insertion(+) diff --git a/memory.c b/memory.c index 28f6449..7764314 100644 --- a/memory.c +++ b/memory.c @@ -1596,6 +1596,7 @@ MemoryRegionSection memory_region_find(MemoryRegion *mr, view = address_space_get_flatview(as); fr = flatview_lookup(view, range); if (!fr) { + flatview_unref(view); return ret; } -- 1.7.9.5