提交 049d8754 编写于 作者: G Guixin Liu 提交者: Jialin Zhang

scsi: megaraid_sas: Fix double kfree()

stable inclusion
from stable-v5.10.143
commit a175aed83eb4bfcc9697e29c8c14c5379886e955
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I6D0U6

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=a175aed83eb4bfcc9697e29c8c14c5379886e955

--------------------------------

[ Upstream commit 8c499e49 ]

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: NSumit Saxena <sumit.saxena@broadcom.com>
Signed-off-by: NGuixin Liu <kanie@linux.alibaba.com>
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NJialin Zhang <zhangjialin11@huawei.com>
Reviewed-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 df486bdf
...@@ -5209,7 +5209,6 @@ megasas_alloc_fusion_context(struct megasas_instance *instance) ...@@ -5209,7 +5209,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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册