Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6241330imu; Sun, 2 Dec 2018 13:16:58 -0800 (PST) X-Google-Smtp-Source: AFSGD/Wes/DLx41qC2qHy2Y0VmjYTdhTlpv039OrklrIcPK7fEOutmVlxaj/uM0qxkXZLny6lxsM X-Received: by 2002:a17:902:a40f:: with SMTP id p15mr13829981plq.286.1543785418288; Sun, 02 Dec 2018 13:16:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543785418; cv=none; d=google.com; s=arc-20160816; b=EDQcC5VXkc2P3JictCwbG6tH3sMz0ETDpwfbhCNivC46/8n53OC9f556gmM4rAyl8G XgxoImPTGda9/im4rG9U7LOW38mwsal7gSeUrvBd95Lbs+3nrCEI0aw5odR1PQQ0f1o1 aaPHVXOMZSarInTxJkncXCpnzRlAYDXFMDBVC7xOkD5jeItD2XEVRMTfuMMEskyVTXtW adXc0YVSvCoVHn3VLetnoLOFGJPo8YjoB7mZTf87TahaID/HDUCRPg4nADP8Li/2BU4g bN1+auZum4i0pPiRyCSdLDo2aA5HDMVvuUG3uGmReAtNQ7rGH2Ym9FVePCPLZrEnNbnh TKaw== 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=aWM74e3lsZMERL/NHwkMRkIqyf7CAn8dD1frigMCb+U=; b=K/N8/gbgNFWYlpeDiYrUy0VvSqDs73HpkR+8ioS30Pq+NRlrPocTp6ul/NNQVYtBdV 8pi28iCeqLg1265soYVQc0QEWeNOmed2mEhTiraRA98xwuiewY/drIiHasjUX74u3XYO ZETf9ENQLj4hEeRKS/Rq70sH+tOC+twP0J/n1FlOcFoGuuHG3tmeAggVOizBPooR3CUq bQaGrQJpCWTJWaKan1xbZ2ppk5RQpiSrXEnZeNNP05n2fFyQz84KeQZRZD5Kf73auru8 642/oGLJDwrQLmXWpNF5Bhrms3BiDo1l5OXrX6Lw6pmu1qaEZ4BmAcqq1r6Dd0BY8OQQ Mn7g== 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 h20si10443120pgm.366.2018.12.02.13.16.43; Sun, 02 Dec 2018 13:16:58 -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 S1725838AbeLBVOs (ORCPT + 99 others); Sun, 2 Dec 2018 16:14:48 -0500 Received: from www17.your-server.de ([213.133.104.17]:57358 "EHLO www17.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725778AbeLBVOr (ORCPT ); Sun, 2 Dec 2018 16:14:47 -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 1gTYlr-00016c-KQ; Sun, 02 Dec 2018 21:55:19 +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 1gTYlr-0002oe-FH; Sun, 02 Dec 2018 21:55:19 +0100 Subject: [PATCH] scsi: qla4xxx: NULL check before some freeing functions is not needed. From: Thomas Meyer To: QLogic-Storage-Upstream@qlogic.com, jejb@linux.vnet.ibm.com, martin.petersen@oracle.com, linux-scsi@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: <1543760930052-1104447559-14-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: 14 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/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c --- a/drivers/scsi/qla4xxx/ql4_os.c +++ b/drivers/scsi/qla4xxx/ql4_os.c @@ -4160,20 +4160,17 @@ static void qla4xxx_mem_free(struct scsi ha->fw_dump_size = 0; /* Free srb pool. */ - if (ha->srb_mempool) - mempool_destroy(ha->srb_mempool); + mempool_destroy(ha->srb_mempool); ha->srb_mempool = NULL; - if (ha->chap_dma_pool) - dma_pool_destroy(ha->chap_dma_pool); + dma_pool_destroy(ha->chap_dma_pool); if (ha->chap_list) vfree(ha->chap_list); ha->chap_list = NULL; - if (ha->fw_ddb_dma_pool) - dma_pool_destroy(ha->fw_ddb_dma_pool); + dma_pool_destroy(ha->fw_ddb_dma_pool); /* release io space registers */ if (is_qla8022(ha)) {