Skip to content

Commit

Permalink
powerpc/boot: Allocate more memory for dtb
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sebastian Siewior authored and Paul Mackerras committed Nov 5, 2008
1 parent 7d4320f commit 5b4d218
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/powerpc/boot/libfdt-wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 5b4d218

Please sign in to comment.