From: Paolo Bonzini Date: Fri, 27 Jan 2017 15:40:15 +0000 (+0100) Subject: exec: make address_space_cache_destroy idempotent X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=91047df38dffa80222179f63fbb74c1dfefa25ed;p=qemu.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 Signed-off-by: Paolo Bonzini Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- diff --git a/exec.c b/exec.c index 6fa337b8d8..865a1e8295 100644 --- a/exec.c +++ b/exec.c @@ -3166,6 +3166,7 @@ void address_space_cache_destroy(MemoryRegionCache *cache) xen_invalidate_map_cache_entry(cache->ptr); } memory_region_unref(cache->mr); + cache->mr = NULL; } /* Called from RCU critical section. This function has the same