summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorNicolas Pitre <nicolas.pitre@linaro.org>2011-06-09 03:58:36 (GMT)
committerRussell King <rmk+kernel@arm.linux.org.uk>2011-06-09 09:15:06 (GMT)
commitf506cd48a4236b7045d092c9b92709ae6b4bdaf0 (patch)
tree5c4a69e4cc758ae58643d813621da83fc1042de3 /arch
parent6075e9df471e35f2ebf4c73c95c304d0473bd4b2 (diff)
downloadlinux-fsl-qoriq-f506cd48a4236b7045d092c9b92709ae6b4bdaf0.tar.xz
ARM: 6953/1: DT: don't try to access physical address zero
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>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/kernel/devtree.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/arm/kernel/devtree.c b/arch/arm/kernel/devtree.c
index a701e42..0cdd7b4 100644
--- a/arch/arm/kernel/devtree.c
+++ b/arch/arm/kernel/devtree.c
@@ -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 */