mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-12-01 00:49:43 +00:00
cmd: fdt: Map address returned from fdt get addr to sysmem
The address returned from 'fdt get addr' command must be mapped into sysmem, as this is a working FDT. Access to this address without mapping it would lead to crash e.g. in sandbox. The following command triggers the crash: " ./u-boot -Dc 'fdt addr $fdtcontroladdr ; fdt get addr var / compatible ; md $var' " Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
98d114e75c
commit
b363da1c26
1 changed files with 2 additions and 1 deletions
|
@ -468,7 +468,8 @@ static int do_fdt(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
|||
/* Get address */
|
||||
char buf[19];
|
||||
|
||||
snprintf(buf, sizeof(buf), "0x%p", nodep);
|
||||
snprintf(buf, sizeof(buf), "0x%lx",
|
||||
(ulong)map_to_sysmem(nodep));
|
||||
env_set(var, buf);
|
||||
} else if (subcmd[0] == 's') {
|
||||
/* Get size */
|
||||
|
|
Loading…
Reference in a new issue