From mboxrd@z Thu Jan 1 00:00:00 1970 From: jsmart2021@gmail.com Subject: [PATCH-v1 08/22] Remove NULL ptr check before kfree. Date: Wed, 19 Apr 2017 21:46:27 -0700 Message-ID: <20170420044641.10657-9-jsmart2021@gmail.com> References: <20170420044641.10657-1-jsmart2021@gmail.com> Return-path: Received: from mail-oi0-f66.google.com ([209.85.218.66]:35921 "EHLO mail-oi0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S941127AbdDTErI (ORCPT ); Thu, 20 Apr 2017 00:47:08 -0400 Received: by mail-oi0-f66.google.com with SMTP id a3so346371oii.3 for ; Wed, 19 Apr 2017 21:47:08 -0700 (PDT) In-Reply-To: <20170420044641.10657-1-jsmart2021@gmail.com> Sender: linux-scsi-owner@vger.kernel.org List-Id: linux-scsi@vger.kernel.org To: linux-scsi@vger.kernel.org, linux-nvme@lists.infradead.org, sagi@grimberg.me, martin.petersen@oracle.com Cc: James Smart , Dick Kennedy , James Smart From: James Smart The check for NULL ptr is not necessary, kfree will check it. Removing NULL ptr check. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_debugfs.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_debugfs.c b/drivers/scsi/lpfc/lpfc_debugfs.c index 913eed8..76857e2 100644 --- a/drivers/scsi/lpfc/lpfc_debugfs.c +++ b/drivers/scsi/lpfc/lpfc_debugfs.c @@ -5700,10 +5700,8 @@ lpfc_debugfs_terminate(struct lpfc_vport *vport) #ifdef CONFIG_SCSI_LPFC_DEBUG_FS struct lpfc_hba *phba = vport->phba; - if (vport->disc_trc) { - kfree(vport->disc_trc); - vport->disc_trc = NULL; - } + kfree(vport->disc_trc); + vport->disc_trc = NULL; debugfs_remove(vport->debug_disc_trc); /* discovery_trace */ vport->debug_disc_trc = NULL; @@ -5770,10 +5768,8 @@ lpfc_debugfs_terminate(struct lpfc_vport *vport) debugfs_remove(phba->debug_readRef); /* readRef */ phba->debug_readRef = NULL; - if (phba->slow_ring_trc) { - kfree(phba->slow_ring_trc); - phba->slow_ring_trc = NULL; - } + kfree(phba->slow_ring_trc); + phba->slow_ring_trc = NULL; /* slow_ring_trace */ debugfs_remove(phba->debug_slow_ring_trc); -- 2.1.0