All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/shadow: fix uninitialized rc shadow_track_dirty_vram()
@ 2015-05-22  6:29 Jan Beulich
  2015-05-22  7:41 ` Andrew Cooper
  2015-05-22  7:44 ` Tim Deegan
  0 siblings, 2 replies; 3+ messages in thread
From: Jan Beulich @ 2015-05-22  6:29 UTC (permalink / raw)
  To: xen-devel; +Cc: Andrew Cooper, Tim Deegan, Roger Pau Monne

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@suse.com>

--- 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
                             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
     }
 
     if ( !nr )
-    {
-        rc = 0;
         goto out;
-    }
 
     dirty_bitmap = vzalloc(dirty_size);
     if ( dirty_bitmap == NULL )

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-05-22  7:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-22  6:29 [PATCH] x86/shadow: fix uninitialized rc shadow_track_dirty_vram() Jan Beulich
2015-05-22  7:41 ` Andrew Cooper
2015-05-22  7:44 ` Tim Deegan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.