From: Tim Deegan Subject: [PATCH] Fix error path of HVM save hypercall Date: Wed, 3 Dec 2008 15:38:17 +0000 Message-ID: <20081203153817.GO25331@york.uk.xensource.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="tMbDGjvJuJijemkf" Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --tMbDGjvJuJijemkf Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Fix the HVM save hypercall to avoid freeing an uninitalised pointer. Signed-off-by: Tim Deegan --tMbDGjvJuJijemkf Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: attachment; filename=hvmsave diff -r 6ddeca313ce9 xen/arch/x86/domctl.c --- a/xen/arch/x86/domctl.c Wed Dec 03 13:23:34 2008 +0000 +++ b/xen/arch/x86/domctl.c Wed Dec 03 15:12:02 2008 +0000 @@ -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) ) { --tMbDGjvJuJijemkf Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --tMbDGjvJuJijemkf--