Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6241426imu; Sun, 2 Dec 2018 13:17:03 -0800 (PST) X-Google-Smtp-Source: AFSGD/W7ghQPquj93gC2+lWbwWUKN6l5f9Zoh35nuLUiM1mVtWXuo5wDyM3gppyD6HoP0wRkNN2O X-Received: by 2002:a62:4b4d:: with SMTP id y74mr13327530pfa.186.1543785423784; Sun, 02 Dec 2018 13:17:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543785423; cv=none; d=google.com; s=arc-20160816; b=RfFaue6HPEYAeyCkkU2EU/bmHGnB3JhfEFnIOa4FO9wUaYZqPOCKudc+56GGEpQd9k f2PO0eE9Qu2SPK9Bdwxild0qGI01LKLid5pZ8Vznc9zktHjd9NdoMSnMqRGJYYmsWTmm GXaNfhtT0PYvGZdWCoMTXdaHL6dDgF+L0o38U5BbDlOwawlJI/eYJpcFVV6eu9F7CaRq dHq/km5AKcgPLt+e+3pqbyVgJTpyIzlHiT/Xf+CoSYv+3SJ0bpkz97ZOhfC0Y0rHZ+QE vCfqv+opQ3V05ukNR6Mp4XdzhOysA66nk220u2VCIdcp+o55nSNtSkkMpaUpUt+TWeht 9KZw== 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:user-agent:date :in-reply-to:references:message-id:mime-version:to:from:subject; bh=0EZqsvzwm7ataP5YLsIO9Bh5AR4zkcf6FfmzBTkEUOk=; b=QEN2LYXv4J5cA7EkgYSMcyaDSiNqlHXvNnXKq/mwGGQ/Zm9IC3dHQF/5FjAiijQnH8 +f5Dn8WhAdh8H6p2f39hXWHEzR9SDH01Ac0OHylwKfYANyE0wejlE48I9bYxo4TpHqaM niel0qcoxPrDPVvZXfyR3F4Uo/JAcVL8obhl43HD4J5GiX/odfDcixvOV+nGbGNoeHKB E2ZYoYXQr3+IW9EGadmCY0x2McvxsqPR4prfDMuaRRUlYOFK0b1Ruf29iaNTt1vUd5jI 6pAut+SXMCqP7WYeHtMMCDZX1w0vxZA4FzrjHVHDWagCN7K854JAiXRecNXXGv1sUSwQ OOEQ== 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 y1si11111408plt.356.2018.12.02.13.16.49; Sun, 02 Dec 2018 13:17:03 -0800 (PST) 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 S1725973AbeLBVPz (ORCPT + 99 others); Sun, 2 Dec 2018 16:15:55 -0500 Received: from www17.your-server.de ([213.133.104.17]:57668 "EHLO www17.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725952AbeLBVPy (ORCPT ); Sun, 2 Dec 2018 16:15:54 -0500 Received: from [78.46.172.3] (helo=sslproxy06.your-server.de) by www17.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1gTYlt-000170-6e; Sun, 02 Dec 2018 21:55:21 +0100 Received: from [2a02:908:4c28:3f60:fff6:43c5:695c:41d6] (helo=localhost.localdomain) by sslproxy06.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from ) id 1gTYlt-0002v5-0p; Sun, 02 Dec 2018 21:55:21 +0100 Subject: [PATCH] [SCSI] zfcp: NULL check before some freeing functions is not needed. From: Thomas Meyer To: maier@linux.ibm.com, bblock@linux.ibm.com, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 X-Patch: Cocci X-Mailer: DiffSplit Message-ID: <1543760930051-347492467-5-diffsplit-thomas@m3y3r.de> References: <1543760930050-1499171309-0-diffsplit-thomas@m3y3r.de> In-Reply-To: <1543760930050-1499171309-0-diffsplit-thomas@m3y3r.de> X-Serial-No: 5 Date: Sun, 02 Dec 2018 21:52:11 +0100 User-Agent: Evolution 3.30.2 (3.30.2-2.fc29) Content-Transfer-Encoding: 7bit X-Authenticated-Sender: thomas@m3y3r.de X-Virus-Scanned: Clear (ClamAV 0.100.2/25173/Sun Dec 2 15:13:44 2018) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org NULL check before some freeing functions is not needed. Signed-off-by: Thomas Meyer --- diff -u -p a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c --- 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 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); } /**