Message ID | alpine.DEB.2.22.394.2012111113060.2669@hadrien |
---|---|
State | New |
Headers | show |
Series | scsi: megaraid: fix ifnullfree.cocci warnings | expand |
Julia, > NULL check before vfree is not needed. > > Generated by: scripts/coccinelle/free/ifnullfree.cocci Applied to 5.12/scsi-staging, thanks! -- Martin K. Petersen Oracle Linux Engineering
On Fri, 11 Dec 2020 11:16:15 +0100 (CET), Julia Lawall wrote: > 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 -- Martin K. Petersen Oracle Linux Engineering
--- 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;