0a122b
From e5cb4139f938fd2f8e6910f92b15173083a3a517 Mon Sep 17 00:00:00 2001
0a122b
Message-Id: <e5cb4139f938fd2f8e6910f92b15173083a3a517.1387382496.git.minovotn@redhat.com>
0a122b
In-Reply-To: <c5386144fbf09f628148101bc674e2421cdd16e3.1387382496.git.minovotn@redhat.com>
0a122b
References: <c5386144fbf09f628148101bc674e2421cdd16e3.1387382496.git.minovotn@redhat.com>
0a122b
From: Nigel Croxon <ncroxon@redhat.com>
0a122b
Date: Thu, 14 Nov 2013 22:52:49 +0100
0a122b
Subject: [PATCH 13/46] rdma: bugfix: ram_control_save_page()
0a122b
0a122b
RH-Author: Nigel Croxon <ncroxon@redhat.com>
0a122b
Message-id: <1384469598-13137-14-git-send-email-ncroxon@redhat.com>
0a122b
Patchwork-id: 55695
0a122b
O-Subject: [RHEL7.0 PATCH 13/42] rdma: bugfix: ram_control_save_page()
0a122b
Bugzilla: 1011720
0a122b
RH-Acked-by: Orit Wasserman <owasserm@redhat.com>
0a122b
RH-Acked-by: Amit Shah <amit.shah@redhat.com>
0a122b
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
0a122b
0a122b
Bugzilla: 1011720
0a122b
https://bugzilla.redhat.com/show_bug.cgi?id=1011720
0a122b
0a122b
>From commit ID:
0a122b
commit de7b685c9e1cf606e37e7116e4c4f03a6ae2d14f
0a122b
Author: Michael R. Hines <mrhines@us.ibm.com>
0a122b
Date:   Mon Jul 22 10:01:52 2013 -0400
0a122b
0a122b
    rdma: bugfix: ram_control_save_page()
0a122b
0a122b
    We were not checking for a valid 'bytes_sent' pointer before accessing it.
0a122b
0a122b
    Reviewed-by: Eric Blake <eblake@redhat.com>
0a122b
    Signed-off-by: Michael R. Hines <mrhines@us.ibm.com>
0a122b
    Signed-off-by: Juan Quintela <quintela@redhat.com>
0a122b
---
0a122b
 savevm.c |    2 +-
0a122b
 1 files changed, 1 insertions(+), 1 deletions(-)
0a122b
0a122b
Signed-off-by: Michal Novotny <minovotn@redhat.com>
0a122b
---
0a122b
 savevm.c | 2 +-
0a122b
 1 file changed, 1 insertion(+), 1 deletion(-)
0a122b
0a122b
diff --git a/savevm.c b/savevm.c
0a122b
index e0491e7..03fc4d9 100644
0a122b
--- a/savevm.c
0a122b
+++ b/savevm.c
0a122b
@@ -662,7 +662,7 @@ size_t ram_control_save_page(QEMUFile *f, ram_addr_t block_offset,
0a122b
                                     offset, size, bytes_sent);
0a122b
 
0a122b
         if (ret != RAM_SAVE_CONTROL_DELAYED) {
0a122b
-            if (*bytes_sent > 0) {
0a122b
+            if (bytes_sent && *bytes_sent > 0) {
0a122b
                 qemu_update_position(f, *bytes_sent);
0a122b
             } else if (ret < 0) {
0a122b
                 qemu_file_set_error(f, ret);
0a122b
-- 
0a122b
1.7.11.7
0a122b