[Cbe-oss-dev] [PATCH] fix cbe_reg.c for legacy SLOF tree.

Jean-Christophe Dubois jdubois at mc.com
Tue Jun 26 22:58:19 EST 2007


Some legacy SLOF device trees have a "be" node but no "cpus" properties under it. 

So le'ts fix the crash until the device tree is fixed.

Signed-off-by: Jean-Christophe DUBOIS <jcd at tribudubois.net>

Index: linux-2.6.22-rc4/arch/powerpc/platforms/cell/cbe_regs.c
===================================================================
--- linux-2.6.22-rc4.orig/arch/powerpc/platforms/cell/cbe_regs.c
+++ linux-2.6.22-rc4/arch/powerpc/platforms/cell/cbe_regs.c
@@ -174,6 +174,11 @@ static struct device_node *cbe_get_be_no
 
 		cpu_handle = of_get_property(np, "cpus", &len);
 
+		if (!cpu_handle) {
+			WARN_ON_ONCE(!cpu_handle);
+			continue;
+		}
+
 		for (i=0; i<len; i++)
 			if (of_find_node_by_phandle(cpu_handle[i]) == of_get_cpu_node(cpu_id, NULL))
 				return np;



More information about the cbe-oss-dev mailing list