[PATCH] stop NULL pointer dereference in __alloc_pages

From: Martin J. Bligh (Martin.Bligh@us.ibm.com)
Date: Thu Apr 18 2002 - 17:38:14 EST


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 ;-) ).

Please apply ...

Thanks,

Martin.

--- linux-2.4.18-memalloc/mm/page_alloc.c.old Fri Mar 8 18:21:41 2002
+++ linux-2.4.18-memalloc/mm/page_alloc.c Fri Mar 8 18:23:27 2002
@@ -317,6 +317,8 @@
 
         zone = zonelist->zones;
         classzone = *zone;
+ if (classzone == NULL)
+ return NULL;
         min = 1UL << order;
         for (;;) {
                 zone_t *z = *(zone++);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Apr 23 2002 - 22:00:22 EST