]> xenbits.xensource.com Git - qemu-upstream-4.5-testing.git/commitdiff
arch_init: Be sure of only one exit entry with DPRINTF() for ram_load()
authorChen Gang <gang.chen.5i5j@gmail.com>
Thu, 1 May 2014 13:28:11 +0000 (21:28 +0800)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 5 Aug 2014 18:45:11 +0000 (13:45 -0500)
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>
(cherry picked from commit 4798fe55c4d539ddf8c7f5befcddfa145b3c6102)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
arch_init.c

index 85c6d6e40176247b5d90eaf68bc693cead0239e0..9aeb2b568c800d7cd447df47a60d8a6f4badcbc3 100644 (file)
@@ -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) {