From: Olof Johansson Date: Thu, 16 Feb 2006 03:40:44 +0000 (-0600) Subject: [PATCH] powerpc: Fix OOPS in lparcfg on G5 X-Git-Tag: v2.6.16-rc5~72^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2b9a32edba3af9ad4ccb23574bea0cc34455dc43;p=platform%2Fkernel%2Flinux-3.10.git [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 Signed-off-by: Paul Mackerras --- diff --git a/arch/powerpc/kernel/lparcfg.c b/arch/powerpc/kernel/lparcfg.c index 1ae96a8..e789fef 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) 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 *m, void *v) 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;