mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-16 12:11:32 +00:00
common/board_f: Respect original FDT size while relocating
While relocating FDT we reserve some memory for the new FDT and set the size of the FDT with that respect. But FDT may be placed at the end of the RAM leading to memory access beyond it. Fix this by copying exact FDT size bytes, not the reserved size. Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
23da3c682a
commit
53007fc1eb
1 changed files with 1 additions and 1 deletions
|
@ -670,7 +670,7 @@ static int reloc_fdt(void)
|
|||
if (gd->flags & GD_FLG_SKIP_RELOC)
|
||||
return 0;
|
||||
if (gd->new_fdt) {
|
||||
memcpy(gd->new_fdt, gd->fdt_blob, gd->fdt_size);
|
||||
memcpy(gd->new_fdt, gd->fdt_blob, fdt_totalsize(gd->fdt_blob));
|
||||
gd->fdt_blob = gd->new_fdt;
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue