patch-2.4.5 linux/mm/bootmem.c

Next file: linux/mm/filemap.c
Previous file: linux/kernel/resource.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.4/linux/mm/bootmem.c linux/mm/bootmem.c
@@ -83,6 +83,14 @@
 
 	if (!size) BUG();
 
+	if (sidx < 0)
+		BUG();
+	if (eidx < 0)
+		BUG();
+	if (sidx >= eidx)
+		BUG();
+	if ((addr >> PAGE_SHIFT) >= bdata->node_low_pfn)
+		BUG();
 	if (end > bdata->node_low_pfn)
 		BUG();
 	for (i = sidx; i < eidx; i++)
@@ -142,6 +150,9 @@
 							PAGE_SHIFT);
 
 	if (!size) BUG();
+
+	if (align & (align-1))
+		BUG();
 
 	/*
 	 * We try to allocate bootmem pages above 'goal'

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)