All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc: xive: Move a dereference below a NULL test
@ 2018-09-26 12:09 zhong jiang
  2018-10-04  6:14   ` Michael Ellerman
  0 siblings, 1 reply; 3+ messages in thread
From: zhong jiang @ 2018-09-26 12:09 UTC (permalink / raw)
  To: mpe, paulus, akpm; +Cc: npiggin, fbarrat, fthain, linuxppc-dev, linux-kernel

It is safe to move dereference below a NULL test.

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
---
 arch/powerpc/sysdev/xive/common.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/sysdev/xive/common.c b/arch/powerpc/sysdev/xive/common.c
index 959a2a6..9824074 100644
--- a/arch/powerpc/sysdev/xive/common.c
+++ b/arch/powerpc/sysdev/xive/common.c
@@ -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);
 }
-- 
1.7.12.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: powerpc: xive: Move a dereference below a NULL test
  2018-09-26 12:09 [PATCH] powerpc: xive: Move a dereference below a NULL test zhong jiang
@ 2018-10-04  6:14   ` Michael Ellerman
  0 siblings, 0 replies; 3+ messages in thread
From: Michael Ellerman @ 2018-10-04  6:14 UTC (permalink / raw)
  To: zhong jiang, paulus, akpm
  Cc: linux-kernel, linuxppc-dev, fbarrat, npiggin, fthain

On Wed, 2018-09-26 at 12:09:32 UTC, zhong jiang wrote:
> It is safe to move dereference below a NULL test.
> 
> Signed-off-by: zhong jiang <zhongjiang@huawei.com>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/cd5ff94577e004e0a4457e70d0ef3a

cheers

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: powerpc: xive: Move a dereference below a NULL test
@ 2018-10-04  6:14   ` Michael Ellerman
  0 siblings, 0 replies; 3+ messages in thread
From: Michael Ellerman @ 2018-10-04  6:14 UTC (permalink / raw)
  To: zhong jiang, paulus, akpm
  Cc: fthain, linuxppc-dev, linux-kernel, fbarrat, npiggin

On Wed, 2018-09-26 at 12:09:32 UTC, zhong jiang wrote:
> It is safe to move dereference below a NULL test.
> 
> Signed-off-by: zhong jiang <zhongjiang@huawei.com>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/cd5ff94577e004e0a4457e70d0ef3a

cheers

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-10-04  6:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-26 12:09 [PATCH] powerpc: xive: Move a dereference below a NULL test zhong jiang
2018-10-04  6:14 ` Michael Ellerman
2018-10-04  6:14   ` Michael Ellerman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.