Skip to content

Commit

Permalink
ARM: 6953/1: DT: don't try to access physical address zero
Browse files Browse the repository at this point in the history
If the DT physical address is zero, this is equivalent to no DT.
Especially when the actual RAM physical address is not located at zero,
the result of phys_to_virt() would point to la-la-land and crash the
kernel, which crash is completely silent this early during boot.

Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Nicolas Pitre authored and Russell King committed Jun 9, 2011
1 parent 6075e9d commit f506cd4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions arch/arm/kernel/devtree.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ struct machine_desc * __init setup_machine_fdt(unsigned int dt_phys)
unsigned long dt_root;
const char *model;

if (!dt_phys)
return NULL;

devtree = phys_to_virt(dt_phys);

/* check device tree validity */
Expand Down

0 comments on commit f506cd4

Please sign in to comment.