[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] x86/shadow: fix uninitialized rc in shadow_track_dirty_vram()



commit 38276296f21200bf7faf66012da24c52e7f053d2
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Fri May 22 10:13:30 2015 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Fri May 22 10:13:30 2015 +0200

    x86/shadow: fix uninitialized rc in shadow_track_dirty_vram()
    
    Commit bd1b4a71b3 ("x86/shadow: fix shadow_track_dirty_vram to work on
    hvm guests"), trying to mirror its HAP counterpart, deleted a couple of
    assignments to rc without making sure rc is initialized on all paths.
    
    Coverity ID: 1299410
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Acked-by: Tim Deegan <tim@xxxxxxx>
---
 xen/arch/x86/mm/shadow/common.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index 9e9d19f..654bacc 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -3518,7 +3518,7 @@ int shadow_track_dirty_vram(struct domain *d,
                             unsigned long nr,
                             XEN_GUEST_HANDLE_64(uint8) guest_dirty_bitmap)
 {
-    int rc;
+    int rc = 0;
     unsigned long end_pfn = begin_pfn + nr;
     unsigned long dirty_size = (nr + 7) / 8;
     int flush_tlb = 0;
@@ -3550,10 +3550,7 @@ int shadow_track_dirty_vram(struct domain *d,
     }
 
     if ( !nr )
-    {
-        rc = 0;
         goto out;
-    }
 
     dirty_bitmap = vzalloc(dirty_size);
     if ( dirty_bitmap == NULL )
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.