From: Paul Jackson Backout one item from a previous "memory page_alloc minor cleanups" patch. Until and unless we are certain that no one can ever pass an empty zonelist to __alloc_pages(), this check for an empty zonelist (or some BUG equivalent) is essential. The code in get_page_from_freelist() blow ups if passed an empty zonelist. Signed-off-by: Paul Jackson Cc: Christoph Lameter Cc: Nick Piggin Signed-off-by: Andrew Morton --- mm/page_alloc.c | 7 +++++++ 1 file changed, 7 insertions(+) diff -puN mm/page_alloc.c~memory-page-alloc-minor-cleanups-fix mm/page_alloc.c --- a/mm/page_alloc.c~memory-page-alloc-minor-cleanups-fix +++ a/mm/page_alloc.c @@ -994,6 +994,13 @@ __alloc_pages(gfp_t gfp_mask, unsigned i might_sleep_if(wait); restart: + z = zonelist->zones; /* the list of zones suitable for gfp_mask */ + + if (unlikely(*z == NULL)) { + /* Should this ever happen?? */ + return NULL; + } + page = get_page_from_freelist(gfp_mask|__GFP_HARDWALL, order, zonelist, ALLOC_WMARK_LOW|ALLOC_CPUSET); if (page) _