[PATCH] powerpc: Fix OOPS in lparcfg on G5

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

Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
This commit is contained in:
Olof Johansson 2006-02-15 21:40:44 -06:00 committed by Paul Mackerras
parent 0728a2f99e
commit 2b9a32edba
1 changed files with 4 additions and 2 deletions

View File

@ -341,7 +341,7 @@ static int lparcfg_data(struct seq_file *m, void *v)
const char *system_id = ""; const char *system_id = "";
unsigned int *lp_index_ptr, lp_index = 0; unsigned int *lp_index_ptr, lp_index = 0;
struct device_node *rtas_node; struct device_node *rtas_node;
int *lrdrp; int *lrdrp = NULL;
rootdn = find_path_device("/"); rootdn = find_path_device("/");
if (rootdn) { if (rootdn) {
@ -362,7 +362,9 @@ static int lparcfg_data(struct seq_file *m, void *v)
seq_printf(m, "partition_id=%d\n", (int)lp_index); seq_printf(m, "partition_id=%d\n", (int)lp_index);
rtas_node = find_path_device("/rtas"); 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) { if (lrdrp == NULL) {
partition_potential_processors = vdso_data->processorCount; partition_potential_processors = vdso_data->processorCount;