Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751192AbdGMCUy (ORCPT ); Wed, 12 Jul 2017 22:20:54 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:2099 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751061AbdGMCUw (ORCPT ); Wed, 12 Jul 2017 22:20:52 -0400 Subject: Re: [PATCH v3 6/7] libsas: add wait-complete support to sync discovery event To: John Garry , , References: <1499670369-44143-1-git-send-email-wangyijing@huawei.com> <1499670369-44143-7-git-send-email-wangyijing@huawei.com> CC: , , , , , , , , , , , , , , , , , , Johannes Thumshirn , Linuxarm From: wangyijing Message-ID: <5966D8C0.4090908@huawei.com> Date: Thu, 13 Jul 2017 10:19:44 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.177.23.4] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A0B0201.5966D8FE.0031,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 9687bb11971bd0d067f5aa6248d42e72 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 902 Lines: 31 在 2017/7/12 21:51, John Garry 写道: > On 10/07/2017 08:06, Yijing Wang wrote: >> >> static void sas_chain_event(int event, unsigned long *pending, >> @@ -592,9 +596,9 @@ int sas_discover_event(struct asd_sas_port *port, enum discover_event ev) >> { >> struct sas_discovery *disc; >> >> + disc = &port->disc; >> if (!port) >> return 0; >> - disc = &port->disc; >> >> BUG_ON(ev >= DISC_NUM_EVENTS); >> >> diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c >> index 570b2cb..9d26c28 1 > > I was just looking through the code and I noticed this, above. Is there a specific reason to move the NULL check, or was it modified accidentally? > > I mean, if port is NULL I don't think we would get as far as checking it as we would have already de-referenced it. Oh, sorry, it's a accidental change, good catch, thanks! > > > > . >