linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: DT: don't try to access physical address zero
@ 2011-06-09  1:40 Nicolas Pitre
  2011-06-09  1:46 ` Grant Likely
  0 siblings, 1 reply; 2+ messages in thread
From: Nicolas Pitre @ 2011-06-09  1:40 UTC (permalink / raw)
  To: linux-arm-kernel

From: Nicolas Pitre <nicolas.pitre@linaro.org>

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>
CC: Grant Likely <grant.likely@secretlab.ca>
---
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 */

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-06-09  1:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-09  1:40 [PATCH] ARM: DT: don't try to access physical address zero Nicolas Pitre
2011-06-09  1:46 ` Grant Likely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).