ia64/xen-unstable

changeset 15762:6644d8486266

[IA64] Clean up NVRAM failure case

copy_from_GFW_to_nvram() in libxc forgot munmap() if NVRAM data
invalid. Also it forgot free() and close() too.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
author Alex Williamson <alex.williamson@hp.com>
date Fri Aug 24 15:09:14 2007 -0600 (2007-08-24)
parents 0cc2e0a1b2fc
children c21bd325088a
files tools/libxc/ia64/xc_ia64_hvm_build.c
line diff
     1.1 --- a/tools/libxc/ia64/xc_ia64_hvm_build.c	Fri Aug 24 15:06:49 2007 -0600
     1.2 +++ b/tools/libxc/ia64/xc_ia64_hvm_build.c	Fri Aug 24 15:09:14 2007 -0600
     1.3 @@ -684,7 +684,12 @@ copy_from_GFW_to_nvram(int xc_handle, ui
     1.4  
     1.5      /* Check is NVRAM data vaild */
     1.6      if ( !is_valid_address(tmp_ptr) )
     1.7 +    {
     1.8 +        free(pfn_list);
     1.9 +        munmap(tmp_ptr, PAGE_SIZE);
    1.10 +        close(nvram_fd);
    1.11          return -1;
    1.12 +    }
    1.13  
    1.14      addr_from_GFW_4k_align = ((struct nvram_save_addr *)tmp_ptr)->addr;
    1.15      munmap(tmp_ptr, PAGE_SIZE);