scsi: megaraid: Fix ifnullfree.cocci warnings

NULL check before vfree is not needed.

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

Link: https://lore.kernel.org/r/alpine.DEB.2.22.394.2012111113060.2669@hadrien
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>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
kernel test robot 2020-12-11 11:16:15 +01:00 committed by Martin K. Petersen
parent cd9df0c216
commit 12e3ef8b3e

View File

@ -3920,8 +3920,7 @@ megasas_free_host_crash_buffer(struct megasas_instance *instance)
{
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;