summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Apfelbaum <marcel.a@redhat.com>2013-12-02 16:20:59 +0200
committerMichael Roth <mdroth@linux.vnet.ibm.com>2014-02-20 21:59:18 -0600
commit8fa58fe91014abfde61c759e805b8a3bda33bef0 (patch)
tree53d6f7a55cdcd334dafd38750dd84b0f9f7d4edf
parent97f74de48cbedeb2555ddf85c2cfe822ef8eadb2 (diff)
downloadqemu-8fa58fe91014abfde61c759e805b8a3bda33bef0.tar.gz
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 <marcel.a@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> (cherry picked from commit 6307d974f9a28bb6652352f52da97f820427d29d) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
-rw-r--r--memory.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/memory.c b/memory.c
index 28f64491d0..776431416f 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;
}