[PATCH] ppc64: Fix boot memory corruption

Nathan's patch "make OF node fixup code usable at runtim" is introducing a
snaky bug.  We do 2 passes over this code, one to measure how much memory
will be needed so we can allocate a single block, and one to do the actual
fixup.  However, the new code does some result-checking of prom_alloc()
which breaks this mecanism, as the first pass always starts at "0", thus we
fail to measure the additional size properly and allocate a block smaller
than what we'll actually use for the fixup.  This cause us to override
whatever sits there, with variable results depending on the memory layout
of the machine (but typically crashes).

This patch fixes it by starting the "measure" pass with an initial size set
to 16 and not 0.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
1 file changed