]> git.hungrycats.org Git - linux/commit
[PATCH] ppc64: fix off-by-one in mem_init()
authorDave Hansen <haveblue@us.ibm.com>
Mon, 2 Aug 2004 03:09:59 +0000 (20:09 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Mon, 2 Aug 2004 03:09:59 +0000 (20:09 -0700)
commit148d8f9b93de4ed9dcffd0c62cec21042d73fe3b
treefea24d7408502fa6fa65f39c0fdee3ae354a7e30
parent85786b021a845c2c4715668601b6da5ac90072b5
[PATCH] ppc64: fix off-by-one in mem_init()

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>
arch/ppc64/mm/init.c