Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1512757ybz; Sat, 18 Apr 2020 02:34:05 -0700 (PDT) X-Google-Smtp-Source: APiQypIkH4LTea2FyvIJxewAVpvbDNTmSLwv11PHrNyw1d9IzDWlNZvi6L8bU4ATrD3LfOuu2pe0 X-Received: by 2002:a50:f699:: with SMTP id d25mr6459630edn.244.1587202445754; Sat, 18 Apr 2020 02:34:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587202445; cv=none; d=google.com; s=arc-20160816; b=gf1iXMmb5/DvNfshvF98tlArPxrxbx+KyXd6PtIC6c9Bzbguy0HKj6Vzyw970toW7b xPLSg3XcIGJLJgx/IB5mnaTxk8OIYZmyW4xF0Uall333RDYS/bO8JC1NnLyC3dXc4T9n 37PoB/iNiPyKpwFCM3D4T+CQv7yAXm5Jv3DC7XlWwaRsxYpAUkDIWO7j0trSQI/9ypAi jcgFCORQESjhPHsdmxQz1GV16+YkHfeZtMrpfkUu29ePyltnbsAwXuKEw9csFTDwSzOH qUPHsn+VHxZMfj7d0y7wiN+Co7LVjQCPsLaes/XuDUWjm7J2WYKCHvjJQOwo7ES1SQ7A ss+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=zs60w1clTkhkpD+4fcUOoLYDT2BI8M4VtHsbtFL45G4=; b=ROfs8lw/2ymzbsmaQFo2oSbz4nlx7wmiEIqx4byH3rEbsIXaIuFcUPksh1yOtW5GdH 42wmZVDOpOzPsPiHGNrfhZDeuOQ4bbgIYxfsABSwdWK25IozMMltOLxrd43S1TPrpjBg TSR4l1W1+hOjvrW+SP3+eQQHxEM+mTflaK2m5ZPwEtLQtEBPKEXE+HSTnh1nVd0cFky7 Q+NUuNfXk3a0oQpoJAfHg60lc7alQDItCWZOb+9IPtynxYOybuQvBUMMiWrmS4hWouM1 vLZ7GMLsbmrB9P8pg9l+QYKdx43C+Kij8qoeS+EqmDXN3Bba4t4t6B2hwO3TVXkYZVCz dkdw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x24si5949665edr.432.2020.04.18.02.33.42; Sat, 18 Apr 2020 02:34:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725891AbgDRJcf (ORCPT + 99 others); Sat, 18 Apr 2020 05:32:35 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:2796 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725857AbgDRJcf (ORCPT ); Sat, 18 Apr 2020 05:32:35 -0400 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 7BC1CF453326FE1A78F1; Sat, 18 Apr 2020 17:32:33 +0800 (CST) Received: from huawei.com (10.175.124.28) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.487.0; Sat, 18 Apr 2020 17:32:25 +0800 From: Jason Yan To: , , , , , , , , CC: Jason Yan , Hulk Robot Subject: [PATCH] scsi: mpt3sas: remove NULL check before freeing function Date: Sat, 18 Apr 2020 17:58:50 +0800 Message-ID: <20200418095850.34883-1-yanaijie@huawei.com> X-Mailer: git-send-email 2.21.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.124.28] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix the following coccicheck warning: drivers/scsi/mpt3sas/mpt3sas_base.c:4906:3-19: WARNING: NULL check before some freeing functions is not needed. Reported-by: Hulk Robot Signed-off-by: Jason Yan --- drivers/scsi/mpt3sas/mpt3sas_base.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c index 663782bb790d..06285b03fa00 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_base.c +++ b/drivers/scsi/mpt3sas/mpt3sas_base.c @@ -4902,8 +4902,7 @@ _base_release_memory_pools(struct MPT3SAS_ADAPTER *ioc) ioc->pcie_sg_lookup[i].pcie_sgl, ioc->pcie_sg_lookup[i].pcie_sgl_dma); } - if (ioc->pcie_sgl_dma_pool) - dma_pool_destroy(ioc->pcie_sgl_dma_pool); + dma_pool_destroy(ioc->pcie_sgl_dma_pool); } if (ioc->config_page) { -- 2.21.1