From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47344) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VR2gB-0004PW-Mu for qemu-devel@nongnu.org; Tue, 01 Oct 2013 12:20:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VR2fy-0005ym-39 for qemu-devel@nongnu.org; Tue, 01 Oct 2013 12:20:07 -0400 Received: from e28smtp04.in.ibm.com ([122.248.162.4]:33811) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VR2fx-0005xe-CC for qemu-devel@nongnu.org; Tue, 01 Oct 2013 12:19:54 -0400 Received: from /spool/local by e28smtp04.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 1 Oct 2013 21:49:46 +0530 From: "Aneesh Kumar K.V" Date: Tue, 1 Oct 2013 21:49:32 +0530 Message-Id: <1380644373-15500-6-git-send-email-aneesh.kumar@linux.vnet.ibm.com> In-Reply-To: <1380644373-15500-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> References: <1380644373-15500-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH -V4 RESEND 5/6] dump-guest-memory: Check for the correct return value List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: agraf@suse.de, paulus@samba.org Cc: qemu-ppc@nongnu.org, 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 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.2