ARM: DT: don't try to access physical address zero
PATCH 1/1 ARM: DT: don't try to access physical address zero
From: Nicolas Pitre <[email protected]>
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.
---
arch/arm/kernel/devtree.c +3 -0
@@ -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 */
PATCH 1/1 ARM: DT: don't try to access physical address zero
Quoted 9 lines · Nicolas Pitre
From: Nicolas Pitre <[email protected]>
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 <[email protected]>CC Grant Likely <[email protected]>
Hmmm, I thought I had fixed that.
This is obviously correct.
Quoted 15 lines
---
arch/arm/kernel/devtree.c +3
-0@@ -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 */