summaryrefslogtreecommitdiff
path: root/arch_init.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch_init.c')
-rw-r--r--arch_init.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/arch_init.c b/arch_init.c
index 85c6d6e401..9aeb2b568c 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -998,7 +998,8 @@ static int ram_load(QEMUFile *f, void *opaque, int version_id)
seq_iter++;
if (version_id != 4) {
- return -EINVAL;
+ ret = -EINVAL;
+ goto done;
}
do {
@@ -1053,7 +1054,8 @@ static int ram_load(QEMUFile *f, void *opaque, int version_id)
host = host_from_stream_offset(f, addr, flags);
if (!host) {
- return -EINVAL;
+ ret = -EINVAL;
+ goto done;
}
ch = qemu_get_byte(f);
@@ -1063,14 +1065,16 @@ static int ram_load(QEMUFile *f, void *opaque, int version_id)
host = host_from_stream_offset(f, addr, flags);
if (!host) {
- return -EINVAL;
+ ret = -EINVAL;
+ goto done;
}
qemu_get_buffer(f, host, TARGET_PAGE_SIZE);
} else if (flags & RAM_SAVE_FLAG_XBZRLE) {
void *host = host_from_stream_offset(f, addr, flags);
if (!host) {
- return -EINVAL;
+ ret = -EINVAL;
+ goto done;
}
if (load_xbzrle(f, addr, host) < 0) {