From: Sebastian Siewior Date: Sat, 1 Nov 2008 10:00:56 +0000 (+0000) Subject: powerpc/boot: Allocate more memory for dtb X-Git-Tag: v2.6.29-rc1~574^2~125 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=5b4d2189446fd31cd618bbd1c24566b8d0ab11c8;p=~emulex%2Finfiniband.git powerpc/boot: Allocate more memory for dtb 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 Signed-off-by: Paul Mackerras --- diff --git a/arch/powerpc/boot/libfdt-wrapper.c b/arch/powerpc/boot/libfdt-wrapper.c index 9276327bc2b..bb8b9b3505e 100644 --- a/arch/powerpc/boot/libfdt-wrapper.c +++ b/arch/powerpc/boot/libfdt-wrapper.c @@ -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");