Commit 8c499e49 authored by Guixin Liu's avatar Guixin Liu Committed by Martin K. Petersen

scsi: megaraid_sas: Fix double kfree()

When allocating log_to_span fails, kfree(instance->ctrl_context) is called
twice. Remove redundant call.

Link: https://lore.kernel.org/r/1659424729-46502-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 6d17a112
...@@ -5310,7 +5310,6 @@ megasas_alloc_fusion_context(struct megasas_instance *instance) ...@@ -5310,7 +5310,6 @@ megasas_alloc_fusion_context(struct megasas_instance *instance)
if (!fusion->log_to_span) { if (!fusion->log_to_span) {
dev_err(&instance->pdev->dev, "Failed from %s %d\n", dev_err(&instance->pdev->dev, "Failed from %s %d\n",
__func__, __LINE__); __func__, __LINE__);
kfree(instance->ctrl_context);
return -ENOMEM; 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