]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[POWERPC] bootwrapper: Preserve the pp pointer in ft_make_space() when calling ft_reo...
authorScott Wood <scottwood@freescale.com>
Mon, 12 Mar 2007 20:41:47 +0000 (14:41 -0600)
committerPaul Mackerras <paulus@samba.org>
Tue, 13 Mar 2007 10:15:52 +0000 (21:15 +1100)
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>
arch/powerpc/boot/flatdevtree.c

index 6c1877358aed324a4311d4bd5f616ee1b6b5e717..0fa4f98fe64781625e00ed67f9fc48692d476cb2 100644 (file)
@@ -261,8 +261,14 @@ static int ft_make_space(struct ft_cxt *cxt, char **pp, enum ft_rgn_id rgn,
        char *str, *next;
        enum ft_rgn_id r;
 
-       if (!cxt->isordered && !ft_reorder(cxt, nextra))
-               return 0;
+       if (!cxt->isordered) {
+               unsigned long rgn_off = *pp - cxt->rgn[rgn].start;
+
+               if (!ft_reorder(cxt, nextra))
+                       return 0;
+
+               *pp = cxt->rgn[rgn].start + rgn_off;
+       }
        if (ft_shuffle(cxt, pp, rgn, nextra))
                return 1;