yeahuh / rpms / qemu-kvm

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