]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
powerpc/boot: Allocate more memory for dtb
authorSebastian Siewior <bigeasy@linutronix.de>
Sat, 1 Nov 2008 10:00:56 +0000 (10:00 +0000)
committerPaul Mackerras <paulus@samba.org>
Wed, 5 Nov 2008 22:49:43 +0000 (09:49 +1100)
David Gibson suggested that since we are now unconditionally copying
the dtb into a malloc()ed buffer, it would be sensible to add a little
padding to the buffer at that point, so that further device tree
manipulations won't need to reallocate it.

This implements that suggestion.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/boot/libfdt-wrapper.c

index 9276327bc2bb1995343dabf417f2c3927386cd95..bb8b9b3505eecd5ce694371f0ababf41f4cf65b1 100644 (file)
@@ -185,7 +185,7 @@ void fdt_init(void *blob)
 
        /* Make sure the dt blob is the right version and so forth */
        fdt = blob;
-       bufsize = fdt_totalsize(fdt) + 4;
+       bufsize = fdt_totalsize(fdt) + EXPAND_GRANULARITY;
        buf = malloc(bufsize);
        if(!buf)
                fatal("malloc failed. can't relocate the device tree\n\r");