scsi: pm80xx: Free allocated tags after failure
Subsystems (2)
PATCH 1/1 scsi: pm80xx: Free allocated tags after failure
This change frees resources after an error is detected.
Signed-off-by Francisco Gutierrez <[email protected]>
--- drivers/scsi/pm8001/pm80xx_hwi.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
drivers/scsi/pm8001/pm80xx_hwi.c +10 -2
@@ -4677,8 +4677,12 @@ pm80xx_chip_phy_start_req(struct pm8001_hba_info *pm8001_ha, u8 phy_id) &pm8001_ha->phy[phy_id].dev_sas_addr, SAS_ADDR_SIZE); payload.sas_identify.phy_id = phy_id; -return pm8001_mpi_build_cmd (pm8001_ha,0 , opcode, &payload, + ret =pm8001_mpi_build_cmd (pm8001_ha,0 , opcode, &payload,sizeof (payload),0 ); +if (ret <0 ) +pm8001_tag_free (pm8001_ha, tag); + +return ret; }/**
@@ -4704,8 +4708,12 @@ static int pm80xx_chip_phy_stop_req(struct pm8001_hba_info *pm8001_ha, payload.tag =cpu_to_le32 (tag); payload.phy_id =cpu_to_le32 (phy_id); -return pm8001_mpi_build_cmd (pm8001_ha,0 , opcode, &payload, + ret =pm8001_mpi_build_cmd (pm8001_ha,0 , opcode, &payload,sizeof (payload),0 ); +if (ret <0 ) +pm8001_tag_free (pm8001_ha, tag); + +return ret; }/*
Signature · 1 line
2.50.0.rc2.696.g1fc2a0284f-goog
Quoted 4 lines · Francisco Gutierrez
This change frees resources after an error is detected.
Signed-off-by Francisco Gutierrez <[email protected]>
lgtm.
Acked-by Jack Wang <[email protected]>
Quoted 39 lines
--- drivers/scsi/pm8001/pm80xx_hwi.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)drivers/scsi/pm8001/pm80xx_hwi.c +10
-3@@ -4677,8 +4677,12 @@ pm80xx_chip_phy_start_req(struct pm8001_hba_info *pm8001_ha, u8 phy_id) &pm8001_ha->phy[phy_id].dev_sas_addr, SAS_ADDR_SIZE); payload.sas_identify.phy_id = phy_id; -return pm8001_mpi_build_cmd (pm8001_ha,0 , opcode, &payload, + ret =pm8001_mpi_build_cmd (pm8001_ha,0 , opcode, &payload,sizeof (payload),0 ); +if (ret <0 ) +pm8001_tag_free (pm8001_ha, tag); + +return ret; }/** @@ -4704,8 +4708,12 @@ static int pm80xx_chip_phy_stop_req(struct pm8001_hba_info *pm8001_ha, payload.tag =cpu_to_le32 (tag); payload.phy_id =cpu_to_le32 (phy_id); -return pm8001_mpi_build_cmd (pm8001_ha,0 , opcode, &payload, + ret =pm8001_mpi_build_cmd (pm8001_ha,0 , opcode, &payload,sizeof (payload),0 ); +if (ret <0 ) +pm8001_tag_free (pm8001_ha, tag); + +return ret; }/* -- 2.50.0.rc2.696.g1fc2a0284f-goog
Martin K. Petersen
AppliedFrancisco,
Quoted 1 line
This change frees resources after an error is detected.
Applied to 6.17/scsi-staging, thanks!
Signature · 1 line
Martin K. Petersen
Martin K. Petersen
AppliedQuoted 3 lines · Francisco Gutierrez
This change frees resources after an error is detected.
Applied to 6.17/scsi-queue, thanks!
[1/1] scsi: pm80xx: Free allocated tags after failure
https://git.kernel.org/mkp/scsi/c/258a0a196217
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering