Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1512940ybz; Sat, 18 Apr 2020 02:34:23 -0700 (PDT) X-Google-Smtp-Source: APiQypLpkG3rl8PQwYRYilUMxMmFPj/hvAtYCVkYU4g6bBC9uR7ITZ0eZCbnqAMmPFra2pjpsNt1 X-Received: by 2002:a17:906:7f13:: with SMTP id d19mr7095531ejr.57.1587202463434; Sat, 18 Apr 2020 02:34:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587202463; cv=none; d=google.com; s=arc-20160816; b=xpAr3HLlqO9uLVSsVYfwHix1OQwGRQld2UqtkY8Wa0AVZppestFX0wV6sCwdGvc6Co SgVZIzVxwQF3GRNCW9jfaWCj/KqLGstMHYlRfD9OVBYgB51E3vTKCLu3LxzX4SFfzwAs xAZ/9IDcZ435c62lVqFihBosN4u1grx+074P8cwANh6UmYhu/1I5EEcIw6GI11i4zxvS VXXX8PDW2LkbSg4HI4Jdr+WHox5rSAlq/JktuGbiJhgX47nP5E6t22VwEKI9gitkYiwy JbsRyiOGO7oIk/rqSGVPPh3pnm+FfrWlK3xXOOiRQuOUYbA89ECnp+6r8Aw0NSdZEcl+ 9gJQ== 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=mhP9SzD82lF0YYPwiTBTBLTiWrDdzboXDeO2t2rw/4U=; b=iAhCa6SIDK+CnArQqZwjOTHA7aHb9Veg5Xb33NARmYQ3P2IqXX12HajQCpJT/FS0Dr B8q9NpXVFXa6x95qZ3VtEQ7BLfprpVA5/pDGRbNGpT8Vw37JsdHwG21LuxL9zkIIZtMp rec7ER0x7n+FMWdlA/6IbtpqT2w4zIEbjOPLDN6b54t/T3n1iB25IqS4H6HV8F6xn4wZ n4AM1KBwqDpN3Kgswk3u8ZLSOA01+aSG86B1oHPf5zSy4tJ9+CPDryesiYF3qFrex53K BtiF0XahxBWfBZKchpiMxO+9nE0MmiSCMoSo69HMDNyfFWSXOHNHVYj0wXqAjHZiItCt pvMA== 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 l61si15982634ede.343.2020.04.18.02.34.01; Sat, 18 Apr 2020 02:34:23 -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 S1725964AbgDRJcv (ORCPT + 99 others); Sat, 18 Apr 2020 05:32:51 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:33356 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725857AbgDRJcu (ORCPT ); Sat, 18 Apr 2020 05:32:50 -0400 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 0D556E0AA284D5D3FB5D; Sat, 18 Apr 2020 17:32:48 +0800 (CST) Received: from huawei.com (10.175.124.28) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.487.0; Sat, 18 Apr 2020 17:32:37 +0800 From: Jason Yan To: , , , , , CC: Jason Yan , Hulk Robot Subject: [PATCH] scsi: ipr: remove NULL check before freeing function Date: Sat, 18 Apr 2020 17:59:03 +0800 Message-ID: <20200418095903.35118-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/ipr.c:9533:2-18: WARNING: NULL check before some freeing functions is not needed. Reported-by: Hulk Robot Signed-off-by: Jason Yan --- drivers/scsi/ipr.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index 0db37b4f7265..7d77997d26d4 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c @@ -9529,8 +9529,7 @@ static void ipr_free_cmd_blks(struct ipr_ioa_cfg *ioa_cfg) } } - if (ioa_cfg->ipr_cmd_pool) - dma_pool_destroy(ioa_cfg->ipr_cmd_pool); + dma_pool_destroy(ioa_cfg->ipr_cmd_pool); kfree(ioa_cfg->ipr_cmnd_list); kfree(ioa_cfg->ipr_cmnd_list_dma); -- 2.21.1