aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/boot/flatdevtree.c
diff options
context:
space:
mode:
authorScott Wood <scottwood@freescale.com>2007-03-12 16:41:47 -0400
committerPaul Mackerras <paulus@samba.org>2007-03-13 06:15:52 -0400
commit78438b36011d8ef7d28ef63a30b11801be1eea71 (patch)
treec9fce48213623cbb3b1d37f9d05c9cad6d44d601 /arch/powerpc/boot/flatdevtree.c
parentc8aa72633e65c5c215b0cdd9970642e2a4f9a9a3 (diff)
[POWERPC] bootwrapper: Preserve the pp pointer in ft_make_space() when calling ft_reorder().
The ft_reorder() function may change the start of the region of interest, so the pointer provided by the caller into that region must be fixed up to still point to the same datum. Signed-off-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/boot/flatdevtree.c')
-rw-r--r--arch/powerpc/boot/flatdevtree.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/arch/powerpc/boot/flatdevtree.c b/arch/powerpc/boot/flatdevtree.c
index 6c1877358aed..0fa4f98fe647 100644
--- a/arch/powerpc/boot/flatdevtree.c
+++ b/arch/powerpc/boot/flatdevtree.c
@@ -261,8 +261,14 @@ static int ft_make_space(struct ft_cxt *cxt, char **pp, enum ft_rgn_id rgn,
261 char *str, *next; 261 char *str, *next;
262 enum ft_rgn_id r; 262 enum ft_rgn_id r;
263 263
264 if (!cxt->isordered && !ft_reorder(cxt, nextra)) 264 if (!cxt->isordered) {
265 return 0; 265 unsigned long rgn_off = *pp - cxt->rgn[rgn].start;
266
267 if (!ft_reorder(cxt, nextra))
268 return 0;
269
270 *pp = cxt->rgn[rgn].start + rgn_off;
271 }
266 if (ft_shuffle(cxt, pp, rgn, nextra)) 272 if (ft_shuffle(cxt, pp, rgn, nextra))
267 return 1; 273 return 1;
268 274