From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35581) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UxeWa-0008KO-EZ for qemu-devel@nongnu.org; Fri, 12 Jul 2013 10:40:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UxeWS-0001ZF-Od for qemu-devel@nongnu.org; Fri, 12 Jul 2013 10:40:44 -0400 Received: from e9.ny.us.ibm.com ([32.97.182.139]:49062) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UxeWS-0001Ys-5v for qemu-devel@nongnu.org; Fri, 12 Jul 2013 10:40:36 -0400 Received: from /spool/local by e9.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 12 Jul 2013 10:40:35 -0400 Received: from d01relay05.pok.ibm.com (d01relay05.pok.ibm.com [9.56.227.237]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id 3653E6E804F for ; Fri, 12 Jul 2013 10:40:27 -0400 (EDT) Received: from d01av05.pok.ibm.com (d01av05.pok.ibm.com [9.56.224.195]) by d01relay05.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r6CEeVN6375558 for ; Fri, 12 Jul 2013 10:40:31 -0400 Received: from d01av05.pok.ibm.com (loopback [127.0.0.1]) by d01av05.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r6CEeVTh020317 for ; Fri, 12 Jul 2013 10:40:31 -0400 From: mrhines@linux.vnet.ibm.com Date: Fri, 12 Jul 2013 10:40:22 -0400 Message-Id: <1373640028-5138-3-git-send-email-mrhines@linux.vnet.ibm.com> In-Reply-To: <1373640028-5138-1-git-send-email-mrhines@linux.vnet.ibm.com> References: <1373640028-5138-1-git-send-email-mrhines@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH v3 resend/cleanup 2/8] rdma: bugfix: ram_control_save_page() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aliguori@us.ibm.com, quintela@redhat.com, knoel@redhat.com, owasserm@redhat.com, abali@us.ibm.com, mrhines@us.ibm.com, gokul@us.ibm.com, pbonzini@redhat.com, chegu_vinod@hp.com From: "Michael R. Hines" We were not checking for a valid 'bytes_sent' pointer before accessing it. Signed-off-by: Michael R. Hines --- savevm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/savevm.c b/savevm.c index e0491e7..03fc4d9 100644 --- a/savevm.c +++ b/savevm.c @@ -662,7 +662,7 @@ size_t ram_control_save_page(QEMUFile *f, ram_addr_t block_offset, offset, size, bytes_sent); if (ret != RAM_SAVE_CONTROL_DELAYED) { - if (*bytes_sent > 0) { + if (bytes_sent && *bytes_sent > 0) { qemu_update_position(f, *bytes_sent); } else if (ret < 0) { qemu_file_set_error(f, ret); -- 1.7.10.4