From: Marcel Apfelbaum Date: Mon, 2 Dec 2013 14:20:59 +0000 (+0200) Subject: memory.c: bugfix - ref counting mismatch in memory_region_find X-Git-Tag: v1.7.1~47 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8fa58fe91014abfde61c759e805b8a3bda33bef0;p=thirdparty%2Fqemu.git memory.c: bugfix - ref counting mismatch in memory_region_find '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 --- diff --git a/memory.c b/memory.c index 28f64491d06..776431416f1 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; }