Unlock ramlist lock also in error case

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>

Reviewed-by: Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
Paolo Bonzini 2012-12-20 11:25:45 +01:00 committed by Juan Quintela
parent 47f4dac3fd
commit fb3409de22
1 changed files with 2 additions and 1 deletions

View File

@ -642,12 +642,13 @@ static int ram_save_iterate(QEMUFile *f, void *opaque)
i++; i++;
} }
qemu_mutex_unlock_ramlist();
if (ret < 0) { if (ret < 0) {
bytes_transferred += total_sent; bytes_transferred += total_sent;
return ret; return ret;
} }
qemu_mutex_unlock_ramlist();
qemu_put_be64(f, RAM_SAVE_FLAG_EOS); qemu_put_be64(f, RAM_SAVE_FLAG_EOS);
total_sent += 8; total_sent += 8;
bytes_transferred += total_sent; bytes_transferred += total_sent;