All of lore.kernel.org
 help / color / mirror / Atom feed
* drivers/scsi/megaraid/megaraid_sas_fusion.c:3921:3-8: WARNING: NULL check before some freeing functions is not needed.
@ 2020-12-11  4:11 kernel test robot
  2020-12-11  4:11 ` [PATCH] coccinelle: ifnullfree: fix ifnullfree.cocci warnings kernel test robot
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2020-12-11  4:11 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 1095 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.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
date:   3 months ago
:::::: branch date: 3 hours ago
:::::: commit date: 3 months ago
config: i386-randconfig-c001-20201209 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Julia Lawall <julia.lawall@lip6.fr>


"coccinelle warnings: (new ones prefixed by >>)"
>> drivers/scsi/megaraid/megaraid_sas_fusion.c:3921:3-8: WARNING: NULL check before some freeing functions is not needed.

Please review and possibly fold the followup patch.

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 38798 bytes --]

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

* [PATCH] coccinelle: ifnullfree: fix ifnullfree.cocci warnings
  2020-12-11  4:11 drivers/scsi/megaraid/megaraid_sas_fusion.c:3921:3-8: WARNING: NULL check before some freeing functions is not needed kernel test robot
@ 2020-12-11  4:11 ` kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2020-12-11  4:11 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 2027 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Denis Efremov <efremov@linux.com>
CC: Julia Lawall <Julia.Lawall@lip6.fr>
CC: Kashyap Desai <kashyap.desai@broadcom.com>
CC: Sumit Saxena <sumit.saxena@broadcom.com>
CC: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
CC: "James E.J. Bottomley" <jejb@linux.ibm.com>
CC: "Martin K. Petersen" <martin.petersen@oracle.com>
CC: megaraidlinux.pdl(a)broadcom.com
CC: linux-scsi(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

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

drivers/scsi/megaraid/megaraid_sas_fusion.c:3921:3-8: WARNING: NULL check before some freeing functions is not needed.

 NULL check before some freeing functions is not needed.

 Based on checkpatch warning
 "kfree(NULL) is safe this check is probably not required"
 and kfreeaddr.cocci by Julia Lawall.

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

Fixes: 5e0c074e5b4b ("coccinelle: ifnullfree: add vfree(), kvfree*() functions")
CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

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] 2+ messages in thread

end of thread, other threads:[~2020-12-11  4:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-11  4:11 drivers/scsi/megaraid/megaraid_sas_fusion.c:3921:3-8: WARNING: NULL check before some freeing functions is not needed kernel test robot
2020-12-11  4:11 ` [PATCH] coccinelle: ifnullfree: fix ifnullfree.cocci warnings kernel test robot

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.