Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp483695imm; Sat, 8 Sep 2018 02:55:25 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYNA2G2JGDsRNG7re5HIrnALl/FfKJoktfcw787QLR9l9zVrswTgSQSvxlWCpkOcWGKqfXb X-Received: by 2002:a17:902:280a:: with SMTP id e10-v6mr12094931plb.187.1536400525421; Sat, 08 Sep 2018 02:55:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536400525; cv=none; d=google.com; s=arc-20160816; b=XhrDtY0tc7mui8dvhpGedjTzzBJpfu41+czFxg4pTFV5LZ39CJkAtKUBhtuSq2EcCG 7U2wHMyUSUWyp3WxntqnKWxZdBk+tSDDTboeVNDDJw7A9u34nvRyMTVVQEMpCiiyYkM5 v2/jgge4oWBOclKHfzPJkSMVCq8LCn3e47IU7OxmkIbI5VPBW8Dqr/CFidgiSO8h76iW vk70M+rf+cHKVK8wGKovUu15l2RpqkL3+FHjGQcrxwmEigF0zoW1TiIs+43VGjKGV3FE qG+u0nqw48A+4XnOee5dV8ylCbqoh2h6ryjr4VTqWnYOD2piUbyjvtZr3W0kifM5dtPQ 2YJA== 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=QaKPN9uYJmRfNqPgztg3AJ+vzcfd9OWoFDjslTWt4DA=; b=vPGvxDY+OP0tDyXvXsosLWcZ7NPKU4j+iub0yc1h8j2WRy6VKK0h3kN4fTEtJh0ol8 sXCy2EF2hOMPKknsF/C1Lr5rLHQqY+NyQjXJThO/YlQhOjBHcTOeEymUzka7qN1dil/Z EBOfyZQKSb3bN+T5htQnjHyBmf23W5xSVTnD+iftWHu4LP87AR2fuOQj6VE/uRxOuJ70 WHUKX4lJ+w9NtJ3PNDA7ff84L36+owwqA0XWdySWBKmrTAHiQpm/VM8HHYYhYcwaDgv6 INC8OTMe9ZM28uzcc4K3G/FVF8eJ61A4dQeaTUYU14g8QmuiZngWJW+bHeusV9n8tJfa JGFg== 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 y5-v6si10038988plt.438.2018.09.08.02.55.08; Sat, 08 Sep 2018 02:55:25 -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 S1726605AbeIHOjN (ORCPT + 99 others); Sat, 8 Sep 2018 10:39:13 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:40309 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726307AbeIHOjM (ORCPT ); Sat, 8 Sep 2018 10:39:12 -0400 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 31FD0794FE39D; Sat, 8 Sep 2018 17:53:58 +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; Sat, 8 Sep 2018 17:53:55 +0800 From: zhong jiang To: , , , CC: , Subject: [PATCH] s390: zfcp_aux: remove unnecessary null pointer check before mempool_destroy Date: Sat, 8 Sep 2018 17:41:45 +0800 Message-ID: <1536399705-21676-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 mempool_destroy has taken null pointer check into account. so remove the redundant check. Signed-off-by: zhong jiang --- drivers/s390/scsi/zfcp_aux.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c index 94f4d8f..e06c3f2 100644 --- a/drivers/s390/scsi/zfcp_aux.c +++ b/drivers/s390/scsi/zfcp_aux.c @@ -248,20 +248,13 @@ static int zfcp_allocate_low_mem_buffers(struct zfcp_adapter *adapter) static void zfcp_free_low_mem_buffers(struct zfcp_adapter *adapter) { - if (adapter->pool.erp_req) - mempool_destroy(adapter->pool.erp_req); - if (adapter->pool.scsi_req) - mempool_destroy(adapter->pool.scsi_req); - if (adapter->pool.scsi_abort) - mempool_destroy(adapter->pool.scsi_abort); - if (adapter->pool.qtcb_pool) - mempool_destroy(adapter->pool.qtcb_pool); - if (adapter->pool.status_read_req) - mempool_destroy(adapter->pool.status_read_req); - if (adapter->pool.sr_data) - mempool_destroy(adapter->pool.sr_data); - if (adapter->pool.gid_pn) - mempool_destroy(adapter->pool.gid_pn); + mempool_destroy(adapter->pool.erp_req); + mempool_destroy(adapter->pool.scsi_req); + mempool_destroy(adapter->pool.scsi_abort); + mempool_destroy(adapter->pool.qtcb_pool); + mempool_destroy(adapter->pool.status_read_req); + mempool_destroy(adapter->pool.sr_data); + mempool_destroy(adapter->pool.gid_pn); } /** -- 1.7.12.4