scsi: megaraid: fix ifnullfree.cocci warnings
Subsystems (2)
PATCH 1/1 scsi: megaraid: fix ifnullfree.cocci warnings
From: kernel test robot <[email protected]>
NULL check before vfree is not needed.
Generated by: scripts/coccinelle/free/ifnullfree.cocci
Reported-by kernel test robot <[email protected]>
Signed-off-by kernel test robot <[email protected]>
Signed-off-by Julia Lawall <[email protected]>
---
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(-)
drivers/scsi/megaraid/megaraid_sas_fusion.c +1 -2
@@ -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 ;
Martin K. Petersen
AppliedJulia,
Quoted 3 lines
NULL check before vfree is not needed.
Generated by:
scripts/coccinelle/free/ifnullfree.cocci
Applied to 5.12/scsi-staging, thanks!
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering
Martin K. Petersen
AppliedQuoted 3 lines · Julia Lawall
NULL check before vfree is not needed.
Generated by:
scripts/coccinelle/free/ifnullfree.cocci
Applied to 5.12/scsi-queue, thanks!
[1/1] scsi: megaraid: fix ifnullfree.cocci warnings
https://git.kernel.org/mkp/scsi/c/12e3ef8b3e7c
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering