mirror of https://github.com/xqemu/xqemu.git
exec: make address_space_cache_destroy idempotent
Clear cache->mr so that address_space_cache_destroy does nothing the second time it is called. Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
9796d0ac8f
commit
91047df38d
1
exec.c
1
exec.c
|
@ -3166,6 +3166,7 @@ void address_space_cache_destroy(MemoryRegionCache *cache)
|
||||||
xen_invalidate_map_cache_entry(cache->ptr);
|
xen_invalidate_map_cache_entry(cache->ptr);
|
||||||
}
|
}
|
||||||
memory_region_unref(cache->mr);
|
memory_region_unref(cache->mr);
|
||||||
|
cache->mr = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Called from RCU critical section. This function has the same
|
/* Called from RCU critical section. This function has the same
|
||||||
|
|
Loading…
Reference in New Issue