lmb_end_of_DRAM() returns the address of the end of RAM, not the starting
address of the last page. We've been accessing mem_map[] out of bounds for
quite a while. But, it's just a read, so it's probably never caused a real
problem.
But, during my port of CONFIG_NONLINEAR to ppc64, I have a check to make
sure that all __va() calls are given with valid physical addresses. This
code tripped that check.
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
totalram_pages += free_all_bootmem();
- for (addr = KERNELBASE; addr <= (unsigned long)__va(lmb_end_of_DRAM());
+ for (addr = KERNELBASE; addr < (unsigned long)__va(lmb_end_of_DRAM());
addr += PAGE_SIZE) {
if (!PageReserved(virt_to_page(addr)))
continue;