Received: from eggs.gnu.org ([2001:4830:134:3::10]:46603) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VHAWN-0006j1-3r for qemu-devel@nongnu.org; Wed, 04 Sep 2013 06:41:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VHAWE-0004oZ-0H for qemu-devel@nongnu.org; Wed, 04 Sep 2013 06:41:11 -0400 Received: from e23smtp09.au.ibm.com ([202.81.31.142]:42055) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VHAWD-0004nS-EG for qemu-devel@nongnu.org; Wed, 04 Sep 2013 06:41:01 -0400 Received: from /spool/local by e23smtp09.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 5 Sep 2013 07:34:49 +1000 Received: from d23relay05.au.ibm.com (d23relay05.au.ibm.com [9.190.235.152]) by d23dlp02.au.ibm.com (Postfix) with ESMTP id 5F8D72BB004F for ; Wed, 4 Sep 2013 20:40:53 +1000 (EST) Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay05.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r84AOMYH2490760 for ; Wed, 4 Sep 2013 20:24:29 +1000 Received: from d23av03.au.ibm.com (localhost [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id r84AeiVx006615 for ; Wed, 4 Sep 2013 20:40:45 +1000 From: "Aneesh Kumar K.V" Date: Wed, 4 Sep 2013 16:10:39 +0530 Message-Id: <1378291239-24217-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH] dump-guest-memory: Check for the correct return value List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: qemu-devel@nongnu.org, "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 --- dump.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dump.c b/dump.c index c0dae2c..80dd9d6 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.2