From 37918ba5b033795f7d3cb121e8df81c78ba6a8b7 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 2 Mar 2018 08:16:15 -0500 Subject: [PATCH] exec: make address_space_cache_destroy idempotent Clear cache->mr so that address_space_cache_destroy does nothing the second time it is called. Backports commit 91047df38dffa80222179f63fbb74c1dfefa25ed from qemu --- qemu/exec.c | 1 + 1 file changed, 1 insertion(+) diff --git a/qemu/exec.c b/qemu/exec.c index 7b071766..901d642d 100644 --- a/qemu/exec.c +++ b/qemu/exec.c @@ -2474,6 +2474,7 @@ void address_space_cache_destroy(MemoryRegionCache *cache) } #endif memory_region_unref(cache->mr); + cache->mr = NULL; } /* Called from RCU critical section. This function has the same