Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <bigeasy@linutronix.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>

authored by

Sebastian Siewior and committed by
Paul Mackerras
5b4d2189 7d4320f3

+1 -1
+1 -1
arch/powerpc/boot/libfdt-wrapper.c
··· 185 185 186 186 /* Make sure the dt blob is the right version and so forth */ 187 187 fdt = blob; 188 - bufsize = fdt_totalsize(fdt) + 4; 188 + bufsize = fdt_totalsize(fdt) + EXPAND_GRANULARITY; 189 189 buf = malloc(bufsize); 190 190 if(!buf) 191 191 fatal("malloc failed. can't relocate the device tree\n\r");