[01/14] Unlock ramlist lock also in error case

Submitted by Juan Quintela on Jan. 15, 2013, 11:18 a.m.

Details

Message ID 1358248702-14278-2-git-send-email-quintela@redhat.com
State New
Headers show

Commit Message

Juan Quintela Jan. 15, 2013, 11:18 a.m.
From: Paolo Bonzini <pbonzini@redhat.com>

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 arch_init.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/arch_init.c b/arch_init.c
index 86f8544..8c833b6 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -642,12 +642,13 @@  static int ram_save_iterate(QEMUFile *f, void *opaque)
         i++;
     }

+    qemu_mutex_unlock_ramlist();
+
     if (ret < 0) {
         bytes_transferred += total_sent;
         return ret;
     }

-    qemu_mutex_unlock_ramlist();
     qemu_put_be64(f, RAM_SAVE_FLAG_EOS);
     total_sent += 8;
     bytes_transferred += total_sent;