mirror of https://github.com/xemu-project/xemu.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 <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 6307d974f9
)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
This commit is contained in:
parent
97f74de48c
commit
8fa58fe910
1
memory.c
1
memory.c
|
@ -1596,6 +1596,7 @@ MemoryRegionSection memory_region_find(MemoryRegion *mr,
|
||||||
view = address_space_get_flatview(as);
|
view = address_space_get_flatview(as);
|
||||||
fr = flatview_lookup(view, range);
|
fr = flatview_lookup(view, range);
|
||||||
if (!fr) {
|
if (!fr) {
|
||||||
|
flatview_unref(view);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue