Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp686815imm; Wed, 26 Sep 2018 05:23:40 -0700 (PDT) X-Google-Smtp-Source: ACcGV61jOKBOBgWl2cOHpKf3DzK21NeD9I4QOj54yA/vI3Re3LOYUmLACppLy4Vt+jNlp8pL1+7b X-Received: by 2002:a63:1064:: with SMTP id 36-v6mr5516811pgq.254.1537964620711; Wed, 26 Sep 2018 05:23:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537964620; cv=none; d=google.com; s=arc-20160816; b=e65mprMTNXDzSZ+jdAVlji4iqqLo23nq4WcfVL4jqGt1RaZUUDldMXsGtM2JeAz6qA kblc2U3iU6QGCz1rB4cczBwI3z8bjpufim9/dV89x7Tk3XIa+IEX0h7HlqpRJrpNzjrY g0x9bmU+QxjPMzNhxAdEXDcvvix9327NnEjy3MXKDeLixFK/gtli6z2zssiP7nL3OjId 7GiyUJE4U/0SdL5ONxaawlD0LjRJlFliZyhsYvqieldszyRwHXnSnykLDZEOyIrz+zfe ER/+VsliQ3i3yBf2hbHh9WS6VbOR6Z30WhtDcwMfBsryO7rRcirX6u9Ymr/19iT+GcIM wT/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=OGctvA3MdeMh20FA6VhkQWPfzfcJNFd0D3lxkXkgSNw=; b=H4LNUv4DrFvLI4t5RYGE918bH7q71zFkiM0Tam4l456qIJ6QI98IjdZC0yD78YQKC/ kFcTZ2RYCqDyYpxtydFqP5/NYjyRhrTuuKTX5LP2OVg6sP6Cz8qgq/KrjTo/BFpxG7Vd uvJ7jKG9T7p8kjy1AgopyQV7XtEb2a2PXzkua0HJcr5lDxJY7g1/fHbW0rco5P4ESpmy 82wpsBJFizmjhghHxuG7MuW6nrDSvsCntlFthSOJuIVkrjA9HwV9uengigIkKcdQrXqD 6GtAL/KSGW6BmChan95p+h3mZodfIC0WBFEKQeWzCEP3SZrCaIdGKZCIE4UCGZlMNUuQ bbeg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i2-v6si4896877pfe.334.2018.09.26.05.23.24; Wed, 26 Sep 2018 05:23:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727186AbeIZSer (ORCPT + 99 others); Wed, 26 Sep 2018 14:34:47 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:48633 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726937AbeIZSer (ORCPT ); Wed, 26 Sep 2018 14:34:47 -0400 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 2376B46C56AA6; Wed, 26 Sep 2018 20:21:59 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.399.0; Wed, 26 Sep 2018 20:21:59 +0800 From: zhong jiang To: , , CC: , , , , Subject: [PATCH] powerpc: xive: Move a dereference below a NULL test Date: Wed, 26 Sep 2018 20:09:32 +0800 Message-ID: <1537963772-15309-1-git-send-email-zhongjiang@huawei.com> X-Mailer: git-send-email 1.7.12.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It is safe to move dereference below a NULL test. Signed-off-by: zhong jiang --- 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