ARM: Handle no IPI being registered in show_ipi_list()
authorMarc Zyngier <maz@kernel.org>
Fri, 25 Sep 2020 15:22:00 +0000 (16:22 +0100)
committerMarc Zyngier <maz@kernel.org>
Mon, 28 Sep 2020 10:32:04 +0000 (11:32 +0100)
As SMP-on-UP is a valid configuration on 32bit ARM, do not assume that
IPIs are populated in show_ipi_list().

Reported-by: Guillaume Tucker <guillaume.tucker@collabora.com>
Reported-by: kernelci.org bot <bot@kernelci.org>
Tested-by: Guillaume Tucker <guillaume.tucker@collabora.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm/kernel/smp.c

index 8425da5..48099c6 100644 (file)
@@ -541,7 +541,12 @@ void show_ipi_list(struct seq_file *p, int prec)
        unsigned int cpu, i;
 
        for (i = 0; i < NR_IPI; i++) {
-               unsigned int irq = irq_desc_get_irq(ipi_desc[i]);
+               unsigned int irq;
+
+               if (!ipi_desc[i])
+                       continue;
+
+               irq = irq_desc_get_irq(ipi_desc[i]);
                seq_printf(p, "%*s%u: ", prec - 1, "IPI", i);
 
                for_each_online_cpu(cpu)