mirror of https://github.com/proxmox/mirror_qemu
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>master
parent
7a10ef51c2
commit
6307d974f9
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