diff mbox series

scsi: fnic: remove redundant NULL check

Message ID 1647309219-12772-1-git-send-email-baihaowen@meizu.com (mailing list archive)
State New, archived
Headers show
Series scsi: fnic: remove redundant NULL check | expand

Commit Message

baihaowen March 15, 2022, 1:53 a.m. UTC
Fix below warnings reported by coccicheck:
drivers/scsi/fnic/fnic_debugfs.c:90:2-7: WARNING: NULL check before some freeing functions is not needed.

Signed-off-by: Haowen Bai <baihaowen@meizu.com>
---
 drivers/scsi/fnic/fnic_debugfs.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Martin K. Petersen May 3, 2022, 12:51 a.m. UTC | #1
On Tue, 15 Mar 2022 09:53:39 +0800, Haowen Bai wrote:

> Fix below warnings reported by coccicheck:
> drivers/scsi/fnic/fnic_debugfs.c:90:2-7: WARNING: NULL check before some freeing functions is not needed.
> 
> 

Applied to 5.19/scsi-queue, thanks!

[1/1] scsi: fnic: remove redundant NULL check
      https://git.kernel.org/mkp/scsi/c/1dcd96c4d0b7
diff mbox series

Patch

diff --git a/drivers/scsi/fnic/fnic_debugfs.c b/drivers/scsi/fnic/fnic_debugfs.c
index e732650..866b4c9 100644
--- a/drivers/scsi/fnic/fnic_debugfs.c
+++ b/drivers/scsi/fnic/fnic_debugfs.c
@@ -86,8 +86,7 @@  void fnic_debugfs_terminate(void)
 	debugfs_remove(fnic_trace_debugfs_root);
 	fnic_trace_debugfs_root = NULL;
 
-	if (fc_trc_flag)
-		vfree(fc_trc_flag);
+	vfree(fc_trc_flag);
 }
 
 /*