[PATCH] Fix the Kernel Crash if Initrd is not passed in Device tree

Shaju Abraham shaju.abraham at linaro.org
Mon Sep 20 20:28:54 EST 2010


The code should check for the size of the phys_initrd_size rather than
phys_devtree_size before calling memblock_reserve().If initrd is not passed
from the Device Tree  the parameters phys_initrd_start, and phys_initrd_size are
zeros.The kernel complaints with a BUG if the arguments passed to memblock_reserve
are zeroes.

Signed-off-by: Shaju Abraham <shaju.abraham at linaro.org>
---
This patch applies to Grant Likely's tree test-devtree branch

 arch/arm/mm/init.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 9ddace8..018b76e 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -310,7 +310,7 @@ void __init arm_memblock_init(struct meminfo *mi, struct machine_desc *mdesc)
 	}
 #endif
 #ifdef CONFIG_OF_FLATTREE
-	if (phys_devtree_size)
+	if (phys_initrd_size)
 		memblock_reserve(phys_initrd_start, phys_initrd_size);
 #endif
 
-- 
1.7.2



More information about the devicetree-discuss mailing list