aboutsummaryrefslogtreecommitdiffstats
path: root/xen-2.4.16/common/page_alloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'xen-2.4.16/common/page_alloc.c')
-rw-r--r--xen-2.4.16/common/page_alloc.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/xen-2.4.16/common/page_alloc.c b/xen-2.4.16/common/page_alloc.c
index b7cd2c1a7b..72785c8a35 100644
--- a/xen-2.4.16/common/page_alloc.c
+++ b/xen-2.4.16/common/page_alloc.c
@@ -178,13 +178,19 @@ unsigned long __get_free_pages(int mask, int order)
spin_lock_irqsave(&alloc_lock, flags);
- /* Found smallest order which can satisfy the request. */
- for ( i = order; FREELIST_EMPTY(free_list[i]); i++ )
- {
- if ( i == FREELIST_SIZE )
- panic("Out of memory!\n");
+
+ /* Find smallest order which can satisfy the request. */
+ for ( i = order; i < FREELIST_SIZE; i++ ) {
+ if ( !FREELIST_EMPTY(free_list[i]) )
+ break;
}
+ if ( i == FREELIST_SIZE )
+ {
+ printk("Cannot handle page request order %d!\n", order);
+ return NULL;
+ }
+
/* Unlink a chunk. */
alloc_ch = free_list[i];
free_list[i] = alloc_ch->next;