powerpc/xive: Move a dereference below a NULL test
authorzhong jiang <zhongjiang@huawei.com>
Wed, 26 Sep 2018 12:09:32 +0000 (20:09 +0800)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 3 Oct 2018 05:40:02 +0000 (15:40 +1000)
Move the dereference of xc below the NULL test.

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/sysdev/xive/common.c

index 959a2a62f23329775beba45473e944395005192a..9824074ec1b5c38dd9d2c7e65f64af659a41c5e0 100644 (file)
@@ -1010,12 +1010,13 @@ static void xive_ipi_eoi(struct irq_data *d)
 {
        struct xive_cpu *xc = __this_cpu_read(xive_cpu);
 
-       DBG_VERBOSE("IPI eoi: irq=%d [0x%lx] (HW IRQ 0x%x) pending=%02x\n",
-                   d->irq, irqd_to_hwirq(d), xc->hw_ipi, xc->pending_prio);
-
        /* Handle possible race with unplug and drop stale IPIs */
        if (!xc)
                return;
+
+       DBG_VERBOSE("IPI eoi: irq=%d [0x%lx] (HW IRQ 0x%x) pending=%02x\n",
+                   d->irq, irqd_to_hwirq(d), xc->hw_ipi, xc->pending_prio);
+
        xive_do_source_eoi(xc->hw_ipi, &xc->ipi_data);
        xive_do_queue_eoi(xc);
 }