scsi: megaraid_sas: fix double kfree
Subsystems (2)
PATCH 1/1 scsi: megaraid_sas: fix double kfree
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.
--- drivers/scsi/megaraid/megaraid_sas_fusion.c | 1 - 1 file changed, 1 deletion(-)
drivers/scsi/megaraid/megaraid_sas_fusion.c +0 -1
@@ -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 ; } }
Signature · 1 line
1.8.3.1
Hi,
Gentle ping.
Quoted 21 lines · Guixin Liu
When alloc
log_to_spanfail, callkfree(instance->ctrl_context)first, then jump tomegasas_free_ctrl_mem()inmegasas_init_fw(), callkfree(instance->ctrl_context)second.Signed-off-by Guixin Liu <[email protected]>--- drivers/scsi/megaraid/megaraid_sas_fusion.c | 1 - 1 file changed, 1 deletion(-)drivers/scsi/megaraid/megaraid_sas_fusion.c +0
-1@@ -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 ; } }
Quoted 6 lines · Guixin Liu
When alloc
log_to_spanfail, callkfree(instance->ctrl_context)first, then jump tomegasas_free_ctrl_mem()inmegasas_init_fw(), callkfree(instance->ctrl_context)second.Signed-off-by Guixin Liu <[email protected]>
Looks good.
Martin K. Petersen
AppliedGuixin,
Quoted 3 lines
When alloc
log_to_spanfail, callkfree(instance->ctrl_context)first, then jump tomegasas_free_ctrl_mem()inmegasas_init_fw(), callkfree(instance->ctrl_context)second.
Applied to 5.20/scsi-staging, thanks!
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering