Commit 0cf094f4 authored by Martin J. Bligh's avatar Martin J. Bligh Committed by Linus Torvalds

[PATCH] stop NULL pointer dereference in __alloc_pages

This trivial patch will apply to both 2.4.19-pre7 and 2.5.8 with just line
offsets. It stops us from following a NULL pointer in classzone in the case
where there is a pgdat without a fully populated zone list (ie a node with
no ZONE_NORMAL on an ia32 NUMA machine). Without this patch, ia32
NUMA machines won't even boot - we dereference the classzone ptr
a few lines further down (or try to ;-) ).
parent 392fe36b
......@@ -340,6 +340,8 @@ struct page * __alloc_pages(unsigned int gfp_mask, unsigned int order, zonelist_
zone = zonelist->zones;
classzone = *zone;
if (classzone == NULL)
return NULL;
min = 1UL << order;
for (;;) {
zone_t *z = *(zone++);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment