[PATCH] [2.6.16] powerpc: Fix OOPS in lparcfg on G5

Olof Johansson olof at lixom.net
Thu Feb 16 14:40:44 EST 2006


On Wed, Feb 15, 2006 at 07:47:41PM -0600, Nathan Lynch wrote:

> Despite the lparcfg name, I think there are apps which depend on it
> even on non-lpar systems; we should still create the file on non-lpar
> Power4, for example.

Hrm, ok. Thanks Nathan.

Paulus, please apply for 2.6.16.


Thanks,

Olof

---


Fallback gracefully when reading /proc/ppc64/lparcfg when the /rtas
device node can't be found.

Signed-off-by: Olof Johansson <olof at lixom.net>


Index: powerpc-git/arch/powerpc/kernel/lparcfg.c
===================================================================
--- powerpc-git.orig/arch/powerpc/kernel/lparcfg.c
+++ powerpc-git/arch/powerpc/kernel/lparcfg.c
@@ -341,7 +341,7 @@ static int lparcfg_data(struct seq_file 
 	const char *system_id = "";
 	unsigned int *lp_index_ptr, lp_index = 0;
 	struct device_node *rtas_node;
-	int *lrdrp;
+	int *lrdrp = NULL;
 
 	rootdn = find_path_device("/");
 	if (rootdn) {
@@ -362,7 +362,9 @@ static int lparcfg_data(struct seq_file 
 	seq_printf(m, "partition_id=%d\n", (int)lp_index);
 
 	rtas_node = find_path_device("/rtas");
-	lrdrp = (int *)get_property(rtas_node, "ibm,lrdr-capacity", NULL);
+	if (rtas_node)
+		lrdrp = (int *)get_property(rtas_node, "ibm,lrdr-capacity",
+		                            NULL);
 
 	if (lrdrp == NULL) {
 		partition_potential_processors = vdso_data->processorCount;



More information about the Linuxppc64-dev mailing list