From: jsmart2021@gmail.com
To: linux-scsi@vger.kernel.org, linux-nvme@lists.infradead.org,
sagi@grimberg.me, martin.petersen@oracle.com
Cc: James Smart <jsmart2021@gmail.com>,
Dick Kennedy <dick.kennedy@broadcom.com>,
James Smart <james.smart@broadcom.com>
Subject: ["PATCH-v2" 08/22] Remove NULL ptr check before kfree.
Date: Thu, 20 Apr 2017 15:04:34 -0700 [thread overview]
Message-ID: <20170420220448.27095-9-jsmart2021@gmail.com> (raw)
In-Reply-To: <20170420220448.27095-1-jsmart2021@gmail.com>
From: James Smart <jsmart2021@gmail.com>
The check for NULL ptr is not necessary, kfree will check it.
Removing NULL ptr check.
Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
---
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 913eed82..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.9.3
next prev parent reply other threads:[~2017-04-20 22:05 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-20 22:04 ["PATCH-v2" 00/22] lpfc updates for 11.2.0.12 jsmart2021
2017-04-20 22:04 ` ["PATCH-v2" 01/22] Standardize nvme SGL segment count jsmart2021
2017-04-20 22:04 ` ["PATCH-v2" 02/22] Fix nvme unregister port timeout jsmart2021
2017-04-20 22:04 ` ["PATCH-v2" 03/22] Fix rejected nvme LS Req jsmart2021
2017-04-20 22:04 ` ["PATCH-v2" 04/22] Fix log message in completion path jsmart2021
2017-04-20 22:04 ` ["PATCH-v2" 05/22] Add debug messages for nvme/fcp resource allocation jsmart2021
2017-04-20 22:04 ` ["PATCH-v2" 06/22] Fix spelling in comments jsmart2021
2017-04-20 22:04 ` ["PATCH-v2" 07/22] Remove unused defines for NVME PostBuf jsmart2021
2017-04-20 22:04 ` jsmart2021 [this message]
2017-04-20 22:04 ` ["PATCH-v2" 09/22] Fix extra line print in rqpair debug print jsmart2021
2017-04-20 22:04 ` ["PATCH-v2" 10/22] Fix PRLI ACC rsp for NVME jsmart2021
2017-04-20 22:04 ` ["PATCH-v2" 11/22] Fix driver unload/reload operation jsmart2021
2017-04-20 22:04 ` ["PATCH-v2" 12/22] Fix driver usage of 128B WQEs when WQ_CREATE is V1 jsmart2021
2017-04-20 22:04 ` ["PATCH-v2" 13/22] Fix nvme initiator handling when not enabled jsmart2021
2017-04-20 22:04 ` ["PATCH-v2" 14/22] Remove hba lock from NVMET issue WQE jsmart2021
2017-04-20 22:04 ` ["PATCH-v2" 15/22] Fix driver load issues when MRQ=8 jsmart2021
2017-04-20 22:04 ` ["PATCH-v2" 16/22] Fix crash after issuing lip reset jsmart2021
2017-04-20 22:04 ` ["PATCH-v2" 17/22] Fix max_sgl_segments settings for NVME / NVMET jsmart2021
2017-04-20 22:04 ` ["PATCH-v2" 18/22] Add Fabric assigned WWN support jsmart2021
2017-04-20 22:04 ` ["PATCH-v2" 19/22] Fix implicit logo and RSCN handling for NVMET jsmart2021
2017-04-20 22:04 ` ["PATCH-v2" 20/22] Update ABORT processing " jsmart2021
2017-04-21 7:07 ` Johannes Thumshirn
2017-04-20 22:04 ` ["PATCH-v2" 21/22] Fix Express lane queue creation jsmart2021
2017-04-20 22:04 ` ["PATCH-v2" 22/22] lpfc revison 11.2.0.12 jsmart2021
2017-04-20 23:52 ` ["PATCH-v2" 00/22] lpfc updates for 11.2.0.12 Sagi Grimberg
2017-04-21 6:22 ` Christoph Hellwig
2017-04-21 14:24 ` Martin K. Petersen
2017-04-21 17:13 ` James Smart
2017-04-21 16:44 ` James Smart
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170420220448.27095-9-jsmart2021@gmail.com \
--to=jsmart2021@gmail.com \
--cc=dick.kennedy@broadcom.com \
--cc=james.smart@broadcom.com \
--cc=linux-nvme@lists.infradead.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=sagi@grimberg.me \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox