aboutsummaryrefslogtreecommitdiff
path: root/arch_init.c
diff options
context:
space:
mode:
authorChen Gang <gang.chen.5i5j@gmail.com>2014-05-01 21:28:11 +0800
committerMichael Tokarev <mjt@tls.msk.ru>2014-05-07 21:00:43 +0400
commit4798fe55c4d539ddf8c7f5befcddfa145b3c6102 (patch)
tree09ac9ad49f1423ce0c3c09363726b6c02d87a837 /arch_init.c
parentad0a118fa322b39887938185911d4fb332617b5c (diff)
arch_init: Be sure of only one exit entry with DPRINTF() for ram_load()
When DPRINTF() has effect, the original author wants to print all ram_load() calling results. So need use 'goto' instead of 'return' within ram_load(), just like other areas have done. Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
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 be743fd1d0..995f56d504 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -1036,7 +1036,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 {
@@ -1091,7 +1092,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);
@@ -1101,14 +1103,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) {