]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
cmd_fdt: save fdtaddr in hex format
authorSudeep Holla <Sudeep.Holla@arm.com>
Fri, 10 Jul 2015 16:18:44 +0000 (17:18 +0100)
committerLothar Waßmann <LW@KARO-electronics.de>
Wed, 9 Sep 2015 11:34:19 +0000 (13:34 +0200)
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 <sudeep.holla@arm.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Tom Rini <trini@konsulko.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Hua Yanghao <huayanghao@gmail.com>
Cc: Heiko Schocher <hs@denx.de>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Simon Glass <sjg@chromium.org>
common/cmd_fdt.c

index 682b6553958fe5afcf60fe78af4c3230f5d03915..4c18962d853283b501729d0b36c6326548c00a1c 100644 (file)
@@ -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);
 }
 
 /*