patch-2.3.29 linux/mm/bootmem.c

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

diff -u --recursive --new-file v2.3.28/linux/mm/bootmem.c linux/mm/bootmem.c
@@ -178,11 +178,11 @@
 			last_offset = offset+size;
 			ret = phys_to_virt(last_pos*PAGE_SIZE + offset);
 		} else {
-			size -= remaining_size;
-			areasize = (size+PAGE_SIZE-1)/PAGE_SIZE;
+			remaining_size = size - remaining_size;
+			areasize = (remaining_size+PAGE_SIZE-1)/PAGE_SIZE;
 			ret = phys_to_virt(last_pos*PAGE_SIZE + offset);
 			last_pos = start+areasize-1;
-			last_offset = size;
+			last_offset = remaining_size;
 		}
  		last_offset &= ~PAGE_MASK;
 	} else {
@@ -196,7 +196,7 @@
 	for (i = start; i < start+areasize; i++)
 		if (test_and_set_bit(i, bootmem_map))
 			BUG();
-
+	memset(ret, 0, size);
 	return ret;
 }
 

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