aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--softmmu/physmem.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/softmmu/physmem.c b/softmmu/physmem.c
index a9adedb9f8..0b31be2928 100644
--- a/softmmu/physmem.c
+++ b/softmmu/physmem.c
@@ -2723,22 +2723,14 @@ static int memory_access_size(MemoryRegion *mr, unsigned l, hwaddr addr)
static bool prepare_mmio_access(MemoryRegion *mr)
{
- bool unlocked = !qemu_mutex_iothread_locked();
bool release_lock = false;
- if (unlocked) {
+ if (!qemu_mutex_iothread_locked()) {
qemu_mutex_lock_iothread();
- unlocked = false;
release_lock = true;
}
if (mr->flush_coalesced_mmio) {
- if (unlocked) {
- qemu_mutex_lock_iothread();
- }
qemu_flush_coalesced_mmio_buffer();
- if (unlocked) {
- qemu_mutex_unlock_iothread();
- }
}
return release_lock;