Commit ffbc6476 authored by Quinn Tran's avatar Quinn Tran Committed by Martin K. Petersen

scsi: qla2xxx: Cleanup fcport memory to prevent leak

Clean up fcport list and loopid in one place and iterate through for loop.
Signed-off-by: default avatarQuinn Tran <qtran@marvell.com>
Signed-off-by: default avatarHimanshu Madhani <hmadhani@marvell.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent a6b95d1c
...@@ -4821,6 +4821,8 @@ qla2x00_free_fcport(fc_port_t *fcport) ...@@ -4821,6 +4821,8 @@ qla2x00_free_fcport(fc_port_t *fcport)
fcport->ct_desc.ct_sns = NULL; fcport->ct_desc.ct_sns = NULL;
} }
list_del(&fcport->list);
qla2x00_clear_loop_id(fcport);
kfree(fcport); kfree(fcport);
} }
......
...@@ -3907,11 +3907,8 @@ void qla2x00_free_fcports(struct scsi_qla_host *vha) ...@@ -3907,11 +3907,8 @@ void qla2x00_free_fcports(struct scsi_qla_host *vha)
{ {
fc_port_t *fcport, *tfcport; fc_port_t *fcport, *tfcport;
list_for_each_entry_safe(fcport, tfcport, &vha->vp_fcports, list) { list_for_each_entry_safe(fcport, tfcport, &vha->vp_fcports, list)
list_del(&fcport->list); qla2x00_free_fcport(fcport);
qla2x00_clear_loop_id(fcport);
kfree(fcport);
}
} }
static inline void static inline void
......
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