mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-19 03:31:26 +00:00
qla2xxx: Cleanup fcport memory to prevent leak
Clean up fcport list and loopid in one place and iterate through for loop. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8223 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -4820,6 +4820,8 @@ qla2x00_free_fcport(fc_port_t *fcport)
|
||||
|
||||
fcport->ct_desc.ct_sns = NULL;
|
||||
}
|
||||
list_del(&fcport->list);
|
||||
qla2x00_clear_loop_id(fcport);
|
||||
kfree(fcport);
|
||||
}
|
||||
|
||||
|
||||
@@ -3965,11 +3965,8 @@ void qla2x00_free_fcports(struct scsi_qla_host *vha)
|
||||
{
|
||||
fc_port_t *fcport, *tfcport;
|
||||
|
||||
list_for_each_entry_safe(fcport, tfcport, &vha->vp_fcports, list) {
|
||||
list_del(&fcport->list);
|
||||
qla2x00_clear_loop_id(fcport);
|
||||
kfree(fcport);
|
||||
}
|
||||
list_for_each_entry_safe(fcport, tfcport, &vha->vp_fcports, list)
|
||||
qla2x00_free_fcport(fcport);
|
||||
}
|
||||
|
||||
static inline void
|
||||
|
||||
Reference in New Issue
Block a user