linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: bfa: remove redundant NULL check
@ 2021-01-22  9:10 Yang Li
  0 siblings, 0 replies; 3+ messages in thread
From: Yang Li @ 2021-01-22  9:10 UTC (permalink / raw)
  To: jejb
  Cc: martin.petersen, anil.gurumurthy, sudarsana.kalluru, linux-scsi,
	linux-kernel, Yang Li

Fix below warnings reported by coccicheck:
./drivers/scsi/bfa/bfad_debugfs.c:375:2-7: WARNING: NULL check before
some freeing functions is not needed.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <abaci-bugfix@linux.alibaba.com>
---
 drivers/scsi/bfa/bfad_debugfs.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/scsi/bfa/bfad_debugfs.c b/drivers/scsi/bfa/bfad_debugfs.c
index fd1b378..52db147 100644
--- a/drivers/scsi/bfa/bfad_debugfs.c
+++ b/drivers/scsi/bfa/bfad_debugfs.c
@@ -371,8 +371,7 @@ struct bfad_debug_info {
 	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);
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] scsi: bfa: remove redundant NULL check
  2022-03-15  1:57 Haowen Bai
@ 2022-05-03  0:51 ` Martin K. Petersen
  0 siblings, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2022-05-03  0:51 UTC (permalink / raw)
  To: sudarsana.kalluru, anil.gurumurthy, Haowen Bai, jejb
  Cc: Martin K . Petersen, linux-kernel, linux-scsi

On Tue, 15 Mar 2022 09:57:14 +0800, Haowen Bai wrote:

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

Applied to 5.19/scsi-queue, thanks!

[1/1] scsi: bfa: remove redundant NULL check
      https://git.kernel.org/mkp/scsi/c/8e897c84661e

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] scsi: bfa: remove redundant NULL check
@ 2022-03-15  1:57 Haowen Bai
  2022-05-03  0:51 ` Martin K. Petersen
  0 siblings, 1 reply; 3+ messages in thread
From: Haowen Bai @ 2022-03-15  1:57 UTC (permalink / raw)
  To: anil.gurumurthy, sudarsana.kalluru, jejb, martin.petersen
  Cc: linux-scsi, linux-kernel, Haowen Bai

Fix below warnings reported by coccicheck:
drivers/scsi/bfa/bfad_debugfs.c:375:2-7: WARNING: NULL check before some freeing functions is not needed.

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

diff --git a/drivers/scsi/bfa/bfad_debugfs.c b/drivers/scsi/bfa/bfad_debugfs.c
index fd1b378..52db147 100644
--- a/drivers/scsi/bfa/bfad_debugfs.c
+++ b/drivers/scsi/bfa/bfad_debugfs.c
@@ -371,8 +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);
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-05-04 11:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-22  9:10 [PATCH] scsi: bfa: remove redundant NULL check Yang Li
2022-03-15  1:57 Haowen Bai
2022-05-03  0:51 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).