diff options
author | Olof Johansson <olof@lixom.net> | 2006-02-15 22:40:44 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-02-19 18:44:34 -0500 |
commit | 2b9a32edba3af9ad4ccb23574bea0cc34455dc43 (patch) | |
tree | dafc13a20cd4f4c280a3e66411189b0b37f9996c /arch | |
parent | 0728a2f99ef6efd1984f9e0ed59834c1cc602e6f (diff) |
[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>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/kernel/lparcfg.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/lparcfg.c b/arch/powerpc/kernel/lparcfg.c index 1ae96a8ed7e2..e789fef4eb8a 100644 --- a/arch/powerpc/kernel/lparcfg.c +++ b/arch/powerpc/kernel/lparcfg.c | |||
@@ -341,7 +341,7 @@ static int lparcfg_data(struct seq_file *m, void *v) | |||
341 | const char *system_id = ""; | 341 | const char *system_id = ""; |
342 | unsigned int *lp_index_ptr, lp_index = 0; | 342 | unsigned int *lp_index_ptr, lp_index = 0; |
343 | struct device_node *rtas_node; | 343 | struct device_node *rtas_node; |
344 | int *lrdrp; | 344 | int *lrdrp = NULL; |
345 | 345 | ||
346 | rootdn = find_path_device("/"); | 346 | rootdn = find_path_device("/"); |
347 | if (rootdn) { | 347 | if (rootdn) { |
@@ -362,7 +362,9 @@ static int lparcfg_data(struct seq_file *m, void *v) | |||
362 | seq_printf(m, "partition_id=%d\n", (int)lp_index); | 362 | seq_printf(m, "partition_id=%d\n", (int)lp_index); |
363 | 363 | ||
364 | rtas_node = find_path_device("/rtas"); | 364 | rtas_node = find_path_device("/rtas"); |
365 | lrdrp = (int *)get_property(rtas_node, "ibm,lrdr-capacity", NULL); | 365 | if (rtas_node) |
366 | lrdrp = (int *)get_property(rtas_node, "ibm,lrdr-capacity", | ||
367 | NULL); | ||
366 | 368 | ||
367 | if (lrdrp == NULL) { | 369 | if (lrdrp == NULL) { |
368 | partition_potential_processors = vdso_data->processorCount; | 370 | partition_potential_processors = vdso_data->processorCount; |