All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: megaraid: fix ifnullfree.cocci warnings
@ 2020-12-11 10:16 ` Julia Lawall
  0 siblings, 0 replies; 10+ messages in thread
From: Julia Lawall @ 2020-12-11 10:16 UTC (permalink / raw)
  To: Kashyap Desai, Sumit Saxena, Shivasharan S, James E.J. Bottomley,
	Martin K. Petersen
  Cc: megaraidlinux.pdl, linux-scsi, linux-kernel, kbuild-all, Denis Efremov

From: kernel test robot <lkp@intel.com>

NULL check before vfree is not needed.

Generated by: scripts/coccinelle/free/ifnullfree.cocci

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@inria.fr>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   33dc9614dc208291d0c4bcdeb5d30d481dcd2c4c
commit: 5e0c074e5b4be02d57d1b60abc3391afe7edd088 coccinelle: ifnullfree: add vfree(), kvfree*() functions
:::::: branch date: 3 hours ago
:::::: commit date: 3 months ago

Please take the patch only if it's a positive warning. Thanks!

 megaraid_sas_fusion.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
+++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
@@ -3917,8 +3917,7 @@ megasas_free_host_crash_buffer(struct me
 {
 	unsigned int i;
 	for (i = 0; i < instance->drv_buf_alloc; i++) {
-		if (instance->crash_buf[i])
-			vfree(instance->crash_buf[i]);
+		vfree(instance->crash_buf[i]);
 	}
 	instance->drv_buf_index = 0;
 	instance->drv_buf_alloc = 0;

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

end of thread, other threads:[~2021-01-27  5:20 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <201707252301.SY4YDAmp%fengguang.wu@intel.com>
2017-07-25 15:40 ` [PATCH] scsi: megaraid: fix ifnullfree.cocci warnings kbuild test robot
2017-07-25 15:48   ` James Bottomley
2017-07-25 15:40 ` kbuild test robot
2017-07-25 15:40 ` kbuild test robot
2020-12-11 10:16 Julia Lawall
2020-12-11 10:16 ` Julia Lawall
2021-01-23  3:25 ` Martin K. Petersen
2021-01-23  3:25   ` Martin K. Petersen
2021-01-27  4:54 ` Martin K. Petersen
2021-01-27  4:54   ` Martin K. Petersen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.