powerpc: Don't print cpu_spec->cpu_name if it's NULL
authorNicholas Piggin <npiggin@gmail.com>
Tue, 9 May 2017 03:17:08 +0000 (13:17 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 9 May 2017 12:56:03 +0000 (22:56 +1000)
Currently we assume that if the cpu_spec has a pvr_mask then it must also have a
cpu_name. But that will change in a subsequent commit when we do CPU feature
discovery via the device tree, so check explicitly if cpu_name is NULL.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/kernel/setup-common.c

index 5c10b5925ac22d29322e50f246f622354f717914..b57df7fc9e5f5c47b3414c93e18a1b58517ac8c7 100644 (file)
@@ -256,7 +256,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
        seq_printf(m, "processor\t: %lu\n", cpu_id);
        seq_printf(m, "cpu\t\t: ");
 
-       if (cur_cpu_spec->pvr_mask)
+       if (cur_cpu_spec->pvr_mask && cur_cpu_spec->cpu_name)
                seq_printf(m, "%s", cur_cpu_spec->cpu_name);
        else
                seq_printf(m, "unknown (%08x)", pvr);