ia64/xen-unstable

changeset 14261:7a39b1e22373

Fix crash in heap allocator when Xen 'zone' is empty.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Mon Mar 05 14:39:03 2007 +0000 (2007-03-05)
parents 2963f61b8135
children f71157f1f1a0
files xen/common/page_alloc.c
line diff
     1.1 --- a/xen/common/page_alloc.c	Mon Mar 05 14:20:26 2007 +0000
     1.2 +++ b/xen/common/page_alloc.c	Mon Mar 05 14:39:03 2007 +0000
     1.3 @@ -342,8 +342,8 @@ static struct page_info *alloc_heap_page
     1.4      unsigned int zone_lo, unsigned zone_hi,
     1.5      unsigned int cpu, unsigned int order)
     1.6  {
     1.7 -    unsigned int i, j, node = cpu_to_node(cpu), num_nodes = num_online_nodes();
     1.8 -    unsigned int zone, request = (1UL << order);
     1.9 +    int i, j, zone, node = cpu_to_node(cpu), num_nodes = num_online_nodes();
    1.10 +    unsigned long request = 1UL << order;
    1.11      struct page_info *pg;
    1.12  
    1.13      ASSERT(node >= 0);
    1.14 @@ -426,7 +426,7 @@ static void free_heap_pages(
    1.15      /* Merge chunks as far as possible. */
    1.16      while ( order < MAX_ORDER )
    1.17      {
    1.18 -        mask = 1 << order;
    1.19 +        mask = 1UL << order;
    1.20  
    1.21          if ( (page_to_mfn(pg) & mask) )
    1.22          {