ia64/xen-unstable

changeset 8367:dda94d6dce94

Small patch to avoid a stack overflow (VTI only).
Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
author djm@kirby.fc.hp.com
date Thu Dec 15 14:51:10 2005 -0600 (2005-12-15)
parents 5eb7ca1878bd
children f998426f9069
files tools/libxc/xc_ia64_stubs.c
line diff
     1.1 --- a/tools/libxc/xc_ia64_stubs.c	Wed Dec 14 13:02:37 2005 -0600
     1.2 +++ b/tools/libxc/xc_ia64_stubs.c	Thu Dec 15 14:51:10 2005 -0600
     1.3 @@ -182,18 +182,26 @@ static int load_hob(int xc_handle,uint32
     1.4  
     1.5  int xc_ia64_build_hob(int xc_handle, uint32_t dom, unsigned long memsize){
     1.6  
     1.7 -    char   hob_buf[GFW_HOB_SIZE];
     1.8 +    char   *hob_buf;
     1.9 +
    1.10 +    hob_buf = malloc (GFW_HOB_SIZE);
    1.11 +    if (hob_buf == NULL) {
    1.12 +        PERROR("Could not allocate hob");
    1.13 +        return -1;
    1.14 +    }
    1.15  
    1.16      if ( build_hob( hob_buf, GFW_HOB_SIZE, memsize<<20) < 0){
    1.17 +        free (hob_buf);
    1.18          PERROR("Could not build hob");
    1.19          return -1;
    1.20      }
    1.21  
    1.22      if ( load_hob( xc_handle, dom, hob_buf) <0){
    1.23 +        free (hob_buf);
    1.24          PERROR("Could not load hob");
    1.25         return -1;
    1.26      }
    1.27 -
    1.28 +    free (hob_buf);
    1.29      return 0;
    1.30  
    1.31  }