[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] [IA64] Clean up NVRAM failure case



# HG changeset patch
# User Alex Williamson <alex.williamson@xxxxxx>
# Date 1187989754 21600
# Node ID 6644d848626685f01d6832837fdb4ab2e06fffde
# Parent  0cc2e0a1b2fcf0f46a23f51e691650893ae5aee9
[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@xxxxxxxxxxxxxx>
---
 tools/libxc/ia64/xc_ia64_hvm_build.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletion(-)

diff -r 0cc2e0a1b2fc -r 6644d8486266 tools/libxc/ia64/xc_ia64_hvm_build.c
--- a/tools/libxc/ia64/xc_ia64_hvm_build.c      Fri Aug 24 15:06:49 2007 -0600
+++ b/tools/libxc/ia64/xc_ia64_hvm_build.c      Fri Aug 24 15:09:14 2007 -0600
@@ -684,7 +684,12 @@ copy_from_GFW_to_nvram(int xc_handle, ui
 
     /* Check is NVRAM data vaild */
     if ( !is_valid_address(tmp_ptr) )
-        return -1;
+    {
+        free(pfn_list);
+        munmap(tmp_ptr, PAGE_SIZE);
+        close(nvram_fd);
+        return -1;
+    }
 
     addr_from_GFW_4k_align = ((struct nvram_save_addr *)tmp_ptr)->addr;
     munmap(tmp_ptr, PAGE_SIZE);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.