From e5cb4139f938fd2f8e6910f92b15173083a3a517 Mon Sep 17 00:00:00 2001 Message-Id: In-Reply-To: References: From: Nigel Croxon Date: Thu, 14 Nov 2013 22:52:49 +0100 Subject: [PATCH 13/46] rdma: bugfix: ram_control_save_page() RH-Author: Nigel Croxon Message-id: <1384469598-13137-14-git-send-email-ncroxon@redhat.com> Patchwork-id: 55695 O-Subject: [RHEL7.0 PATCH 13/42] rdma: bugfix: ram_control_save_page() Bugzilla: 1011720 RH-Acked-by: Orit Wasserman RH-Acked-by: Amit Shah RH-Acked-by: Paolo Bonzini Bugzilla: 1011720 https://bugzilla.redhat.com/show_bug.cgi?id=1011720 >From commit ID: commit de7b685c9e1cf606e37e7116e4c4f03a6ae2d14f Author: Michael R. Hines Date: Mon Jul 22 10:01:52 2013 -0400 rdma: bugfix: ram_control_save_page() We were not checking for a valid 'bytes_sent' pointer before accessing it. Reviewed-by: Eric Blake Signed-off-by: Michael R. Hines Signed-off-by: Juan Quintela --- savevm.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) Signed-off-by: Michal Novotny --- 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.11.7