From: Sudeep Holla Date: Fri, 10 Jul 2015 16:18:44 +0000 (+0100) Subject: cmd_fdt: save fdtaddr in hex format X-Git-Tag: KARO-TX6-2015-09-18~1390 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=59572eb941a444171421e8a7ebb308d254d665c4;p=karo-tx-uboot.git cmd_fdt: save fdtaddr in hex format Commit 90fbee3e4051 ("cmd_fdt: Actually fix fdt command in sandbox") changed the format(from hex address to unsigned long) in which "fdtaddr" is saved . However do_fdt continues reads the "fdtaddr" assuming it to be in hex format. This may lead to fdt being either loaded or attempted to load at erroneous address generating fault if the address is out of memory. This patch changes back the format to hex while saving the "fdtaddr" as it was done before. Signed-off-by: Sudeep Holla Cc: Linus Walleij Cc: Tom Rini Cc: Simon Glass Cc: Hua Yanghao Cc: Heiko Schocher Acked-by: Linus Walleij Acked-by: Simon Glass --- diff --git a/common/cmd_fdt.c b/common/cmd_fdt.c index 682b655395..4c18962d85 100644 --- a/common/cmd_fdt.c +++ b/common/cmd_fdt.c @@ -45,7 +45,7 @@ void set_working_fdt_addr(ulong addr) buf = map_sysmem(addr, 0); working_fdt = buf; - setenv_ulong("fdtaddr", addr); + setenv_hex("fdtaddr", addr); } /*