Commit cd60be49 authored by Roberto Sassu's avatar Roberto Sassu Committed by Martin K. Petersen

scsi: lpfc: avoid double free of resource identifiers

Set variables initialized in lpfc_sli4_alloc_resource_identifiers() to
NULL if an error occurred. Otherwise, lpfc_sli4_driver_resource_unset()
attempts to free the memory again.
Signed-off-by: default avatarRoberto Sassu <>
Signed-off-by: default avatarJohannes Thumshirn <>
Acked-by: default avatarJames Smart <>
Signed-off-by: default avatarMartin K. Petersen <>
parent 98624c4f
...@@ -5954,18 +5954,25 @@ lpfc_sli4_alloc_resource_identifiers(struct lpfc_hba *phba) ...@@ -5954,18 +5954,25 @@ lpfc_sli4_alloc_resource_identifiers(struct lpfc_hba *phba)
free_vfi_bmask: free_vfi_bmask:
kfree(phba->sli4_hba.vfi_bmask); kfree(phba->sli4_hba.vfi_bmask);
phba->sli4_hba.vfi_bmask = NULL;
free_xri_ids: free_xri_ids:
kfree(phba->sli4_hba.xri_ids); kfree(phba->sli4_hba.xri_ids);
phba->sli4_hba.xri_ids = NULL;
free_xri_bmask: free_xri_bmask:
kfree(phba->sli4_hba.xri_bmask); kfree(phba->sli4_hba.xri_bmask);
phba->sli4_hba.xri_bmask = NULL;
free_vpi_ids: free_vpi_ids:
kfree(phba->vpi_ids); kfree(phba->vpi_ids);
phba->vpi_ids = NULL;
free_vpi_bmask: free_vpi_bmask:
kfree(phba->vpi_bmask); kfree(phba->vpi_bmask);
phba->vpi_bmask = NULL;
free_rpi_ids: free_rpi_ids:
kfree(phba->sli4_hba.rpi_ids); kfree(phba->sli4_hba.rpi_ids);
phba->sli4_hba.rpi_ids = NULL;
free_rpi_bmask: free_rpi_bmask:
kfree(phba->sli4_hba.rpi_bmask); kfree(phba->sli4_hba.rpi_bmask);
phba->sli4_hba.rpi_bmask = NULL;
err_exit: err_exit:
return rc; return rc;
} }
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