浏览代码

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>
Sebastian Siewior 16 年之前
父节点
当前提交
5b4d218944
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      arch/powerpc/boot/libfdt-wrapper.c

+ 1 - 1
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");