From 049d8754cd61d7cb0f67b4e5087510fe8b276cf3 Mon Sep 17 00:00:00 2001 From: Guixin Liu Date: Mon, 13 Feb 2023 14:33:26 +0800 Subject: [PATCH] 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 8c499e49240bd93628368c3588975cfb94169b8b ] 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.com Acked-by: Sumit Saxena Signed-off-by: Guixin Liu Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin Signed-off-by: Jialin Zhang Reviewed-by: Zheng Zengkai --- drivers/scsi/megaraid/megaraid_sas_fusion.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c index 1cfa2c9db4f2..39d11c7055b1 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c @@ -5209,7 +5209,6 @@ megasas_alloc_fusion_context(struct megasas_instance *instance) if (!fusion->log_to_span) { dev_err(&instance->pdev->dev, "Failed from %s %d\n", __func__, __LINE__); - kfree(instance->ctrl_context); return -ENOMEM; } } -- GitLab