direct-io.hg

changeset 15115:7812598f65be

[IA64] Return ENOMEM if VPD allocation failed

Usually ASSRET() is "(void)0". Therefore if VPD allocation
fails with xenheap shortage or fragmentation, NULL pointer
access occurs in vmx_final_setup_guest().
This patch fixes it.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
author Alex Williamson <alex.williamson@hp.com>
date Fri May 11 13:07:04 2007 -0600 (2007-05-11)
parents 7d8acd319d5b
children d6309cfd1fdd
files xen/arch/ia64/vmx/vmx_init.c
line diff
     1.1 --- a/xen/arch/ia64/vmx/vmx_init.c	Thu May 10 15:55:22 2007 -0600
     1.2 +++ b/xen/arch/ia64/vmx/vmx_init.c	Fri May 11 13:07:04 2007 -0600
     1.3 @@ -299,6 +299,8 @@ vmx_final_setup_guest(struct vcpu *v)
     1.4  
     1.5  	vpd = alloc_vpd();
     1.6  	ASSERT(vpd);
     1.7 +	if (!vpd)
     1.8 +		return -ENOMEM;
     1.9  
    1.10  	v->arch.privregs = (mapped_regs_t *)vpd;
    1.11  	vcpu_share_privregs_with_guest(v);