[-next] scsi: bfa: Remove unneeded if-null-free check

Message ID 20210601141933.4131855-1-zhengyongjun3@huawei.com
State New
Headers show
Series
  • [-next] scsi: bfa: Remove unneeded if-null-free check
Related show

Commit Message

Zheng Yongjun June 1, 2021, 2:19 p.m.
Eliminate the following coccicheck warning:

drivers/scsi/bfa/bfad_debugfs.c:375:2-7: WARNING:
NULL check before some freeing functions is not needed.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
---
 drivers/scsi/bfa/bfad_debugfs.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Patch

diff --git a/drivers/scsi/bfa/bfad_debugfs.c b/drivers/scsi/bfa/bfad_debugfs.c
index fd1b378a263a..5e419945c6e2 100644
--- a/drivers/scsi/bfa/bfad_debugfs.c
+++ b/drivers/scsi/bfa/bfad_debugfs.c
@@ -371,9 +371,7 @@  bfad_debugfs_release_fwtrc(struct inode *inode, struct file *file)
 	if (!fw_debug)
 		return 0;
 
-	if (fw_debug->debug_buffer)
-		vfree(fw_debug->debug_buffer);
-
+	vfree(fw_debug->debug_buffer);
 	file->private_data = NULL;
 	kfree(fw_debug);
 	return 0;