aboutsummaryrefslogtreecommitdiffstats
path: root/xen-2.4.16/common/page_alloc.c
diff options
context:
space:
mode:
authorsmh22@uridium.cl.cam.ac.uk <smh22@uridium.cl.cam.ac.uk>2002-12-18 18:07:22 +0000
committersmh22@uridium.cl.cam.ac.uk <smh22@uridium.cl.cam.ac.uk>2002-12-18 18:07:22 +0000
commite1c642ea89639d8eff4cafd611542bb7bbb084ae (patch)
treea2f485d5e33d884177f06e0e280bc4e81456d580 /xen-2.4.16/common/page_alloc.c
parentf78e17d1c816a83109803d2489d52c06141c1ff4 (diff)
downloadxen-e1c642ea89639d8eff4cafd611542bb7bbb084ae.tar.gz
xen-e1c642ea89639d8eff4cafd611542bb7bbb084ae.tar.bz2
xen-e1c642ea89639d8eff4cafd611542bb7bbb084ae.zip
bitkeeper revision 1.12 (3e00b95a3fK0b9XF_UVth6TivqeezA)
fix silly large mem request => panic death bug
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;