Skip to contentSkip to conversation

Fix error path of HVM save hypercall

PATCH New Tim Deegan 1 participant 1 message Dec 3, 2008

lore
Share & tools
lore

Tim Deegan

author
#0 lore raw

PATCH 1/1 Fix error path of HVM save hypercall

Fix the HVM save hypercall to avoid freeing an uninitalised pointer.

xen/arch/x86/domctl.c +2 -2
diff -r 6ddeca313ce9 xen/arch/x86/domctl.c
@@ -377,6 +377,8 @@ long arch_do_domctl(
     { 
         struct hvm_domain_context c;
         struct domain             *d;
+        c.data = NULL;
+        c.cur = 0;
 
         ret = -ESRCH;
         if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
@@ -390,9 +392,7 @@ long arch_do_domctl(
         if ( !is_hvm_domain(d) ) 
             goto gethvmcontext_out;
 
-        c.cur = 0;
         c.size = hvm_save_size(d);
-        c.data = NULL;
 
         if ( guest_handle_is_null(domctl->u.hvmcontext.buffer) )
         {

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel