]> Git Repo - qemu.git/commitdiff
exec: make address_space_cache_destroy idempotent
authorPaolo Bonzini <[email protected]>
Fri, 27 Jan 2017 15:40:15 +0000 (16:40 +0100)
committerMichael S. Tsirkin <[email protected]>
Fri, 17 Feb 2017 19:52:30 +0000 (21:52 +0200)
Clear cache->mr so that address_space_cache_destroy does nothing
the second time it is called.

Reviewed-by: Stefan Hajnoczi <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
exec.c

diff --git a/exec.c b/exec.c
index 6fa337b8d8106d0c5ae23a1f612cdbc02079c153..865a1e8295ffb276780802520bd22a188bac6bbb 100644 (file)
--- 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
This page took 0.03224 seconds and 4 git commands to generate.