diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2013-11-25 11:54:48 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2013-11-26 17:21:33 +0100 |
commit | ce0ccefb1575b5208ab08bd70e6a5587a37c62bb (patch) | |
tree | eae38488781c0ac0a8ba01b834b0ffebfe564299 /arch/arm/cpu | |
parent | 94e0337ef08422210fe8f33612f0c19b04c045a4 (diff) | |
download | barebox-ce0ccefb1575b5208ab08bd70e6a5587a37c62bb.tar.gz barebox-ce0ccefb1575b5208ab08bd70e6a5587a37c62bb.tar.xz |
ARM: start: fix fdt inside valid memory check
We want to check whether boarddata contains a valid dtb if it's inside
valid memory. This includes the base of SDRAM, so use '>=' instead of '>'.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/cpu')
-rw-r--r-- | arch/arm/cpu/start.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm/cpu/start.c b/arch/arm/cpu/start.c index f0a7df37bd..21c63c0cc5 100644 --- a/arch/arm/cpu/start.c +++ b/arch/arm/cpu/start.c @@ -82,7 +82,7 @@ static noinline __noreturn void __start(uint32_t membase, uint32_t memsize, * If boarddata is a pointer inside valid memory and contains a * FDT magic then use it as later to probe devices */ - if (boarddata > membase && boarddata < membase + memsize && + if (boarddata >= membase && boarddata < membase + memsize && get_unaligned_be32((void *)boarddata) == FDT_MAGIC) { uint32_t totalsize = get_unaligned_be32((void *)boarddata + 4); endmem -= ALIGN(totalsize, 64); |