Commit 6307d974 authored by Marcel Apfelbaum's avatar Marcel Apfelbaum Committed by Michael S. Tsirkin

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.

Signed-off-by: default avatarMarcel Apfelbaum <>
Reviewed-by: default avatarPaolo Bonzini <>
Reviewed-by: default avatarMichael S. Tsirkin <>
Signed-off-by: default avatarMichael S. Tsirkin <>
parent 7a10ef51
......@@ -1596,6 +1596,7 @@ MemoryRegionSection memory_region_find(MemoryRegion *mr,
view = address_space_get_flatview(as);
fr = flatview_lookup(view, range);
if (!fr) {
return ret;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment