From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33190) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZovZ-0003oN-EK for qemu-devel@nongnu.org; Fri, 25 Oct 2013 17:28:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VZovJ-0002am-Pl for qemu-devel@nongnu.org; Fri, 25 Oct 2013 17:28:17 -0400 From: Alexander Graf Date: Fri, 25 Oct 2013 23:27:51 +0200 Message-Id: <1382736474-32128-27-git-send-email-agraf@suse.de> In-Reply-To: <1382736474-32128-1-git-send-email-agraf@suse.de> References: <1382736474-32128-1-git-send-email-agraf@suse.de> Subject: [Qemu-devel] [PULL 26/29] dump-guest-memory: Check for the correct return value List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: QEMU Developers Cc: Blue Swirl , "qemu-ppc@nongnu.org list:PowerPC" , Anthony Liguori , Aurelien Jarno , "Aneesh Kumar K.V" From: "Aneesh Kumar K.V" We should check for error with s->note_size Signed-off-by: Aneesh Kumar K.V Signed-off-by: Alexander Graf --- dump.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dump.c b/dump.c index 846155c..80a9116 100644 --- a/dump.c +++ b/dump.c @@ -66,7 +66,7 @@ typedef struct DumpState { uint32_t sh_info; bool have_section; bool resume; - size_t note_size; + ssize_t note_size; hwaddr memory_offset; int fd; @@ -765,7 +765,7 @@ static int dump_init(DumpState *s, int fd, bool paging, bool has_filter, s->note_size = cpu_get_note_size(s->dump_info.d_class, s->dump_info.d_machine, nr_cpus); - if (ret < 0) { + if (s->note_size < 0) { error_set(errp, QERR_UNSUPPORTED); goto cleanup; } -- 1.8.1.4