From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38661) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XF83b-0000t9-WB for qemu-devel@nongnu.org; Wed, 06 Aug 2014 16:44:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XF83B-0005RN-61 for qemu-devel@nongnu.org; Wed, 06 Aug 2014 16:43:35 -0400 Received: from e39.co.us.ibm.com ([32.97.110.160]:41693) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XF83A-0005R9-V7 for qemu-devel@nongnu.org; Wed, 06 Aug 2014 16:43:09 -0400 Received: from /spool/local by e39.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 6 Aug 2014 14:43:08 -0600 From: Michael Roth Date: Wed, 6 Aug 2014 15:39:21 -0500 Message-Id: <1407357598-21541-72-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: <1407357598-21541-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1407357598-21541-1-git-send-email-mdroth@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 071/108] arch_init: Be sure of only one exit entry with DPRINTF() for ram_load() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org From: Chen Gang 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 Signed-off-by: Michael Tokarev (cherry picked from commit 4798fe55c4d539ddf8c7f5befcddfa145b3c6102) Signed-off-by: Michael Roth --- arch_init.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/arch_init.c b/arch_init.c index 85c6d6e..9aeb2b5 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) { -- 1.9.1