public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: megaraid_sas: fix double kfree
@ 2022-08-02  7:18 Guixin Liu
  2022-08-08  2:37 ` Guixin Liu
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Guixin Liu @ 2022-08-02  7:18 UTC (permalink / raw)
  To: kashyap.desai, sumit.saxena, shivasharan.srikanteshwara, jejb,
	martin.petersen
  Cc: megaraidlinux.pdl, linux-scsi

When alloc log_to_span fail, call kfree(instance->ctrl_context) first,
then jump to megasas_free_ctrl_mem() in megasas_init_fw(), call
kfree(instance->ctrl_context) second.

Signed-off-by: Guixin Liu <kanie@linux.alibaba.com>
---
 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 5b5885d..3e9b2b0 100644
--- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
+++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
@@ -5311,7 +5311,6 @@ void megasas_fusion_ocr_wq(struct work_struct *work)
 		if (!fusion->log_to_span) {
 			dev_err(&instance->pdev->dev, "Failed from %s %d\n",
 				__func__, __LINE__);
-			kfree(instance->ctrl_context);
 			return -ENOMEM;
 		}
 	}
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-08-12  2:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-02  7:18 [PATCH] scsi: megaraid_sas: fix double kfree Guixin Liu
2022-08-08  2:37 ` Guixin Liu
2022-08-09  7:37 ` Sumit Saxena
2022-08-12  2:13 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox