Commit 7dd6f4af authored by Guixin Liu's avatar Guixin Liu Committed by Martin K. Petersen

scsi: megaraid_sas: Remove unnecessary kfree()

When alloc ctrl mem fails, the reply_map will subsequently be freed in
megasas_free_ctrl_mem(). No need to free it in megasas_alloc_ctrl_mem().

Link: https://lore.kernel.org/r/1659424740-46918-1-git-send-email-kanie@linux.alibaba.comAcked-by: default avatarSumit Saxena <sumit.saxena@broadcom.com>
Signed-off-by: default avatarGuixin Liu <kanie@linux.alibaba.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 8c499e49
...@@ -7150,22 +7150,18 @@ static int megasas_alloc_ctrl_mem(struct megasas_instance *instance) ...@@ -7150,22 +7150,18 @@ static int megasas_alloc_ctrl_mem(struct megasas_instance *instance)
switch (instance->adapter_type) { switch (instance->adapter_type) {
case MFI_SERIES: case MFI_SERIES:
if (megasas_alloc_mfi_ctrl_mem(instance)) if (megasas_alloc_mfi_ctrl_mem(instance))
goto fail; return -ENOMEM;
break; break;
case AERO_SERIES: case AERO_SERIES:
case VENTURA_SERIES: case VENTURA_SERIES:
case THUNDERBOLT_SERIES: case THUNDERBOLT_SERIES:
case INVADER_SERIES: case INVADER_SERIES:
if (megasas_alloc_fusion_context(instance)) if (megasas_alloc_fusion_context(instance))
goto fail; return -ENOMEM;
break; break;
} }
return 0; return 0;
fail:
kfree(instance->reply_map);
instance->reply_map = NULL;
return -ENOMEM;
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment