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
This commit is contained in:
Paolo Bonzini 2018-03-02 08:16:15 -05:00 committed by Lioncash
parent e66da21a56
commit 37918ba5b0
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -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