qla2x00t-32gbit: Do not call scst_unregister_target() twice

If there are any NPIV targets, sqa_exit() will call
scst_unregister_target() twice on them. The first is an explicit call,
the other is triggered by qlt_del_vtarget().

Calling scst_unregister_target() twice on the same target will cause
crash:

RIP: 0010:sqa_target_release+0x19/0x220 [qla2x00tgt]
Call Trace:
  scst_unregister_target+0x8e/0x330 [scst]
  sqa_qla2xxx_remove_target+0x63/0x70 [qla2x00tgt]
  qlt_release+0x1e0/0x260 [qla2xxx_scst]
  qlt_remove_target+0x46/0x1d0 [qla2xxx_scst]
  qla24xx_vport_delete+0x92/0x1e0 [qla2xxx_scst]
  fc_vport_terminate+0x45/0x170 [scsi_transport_fc]
  qlt_del_vtarget+0x142/0x15d [qla2x00tgt]
  fc_vport_terminate+0x45/0x170 [scsi_transport_fc]
  qlt_del_vtarget+0x142/0x15d [qla2x00tgt]
  sqa_exit+0xad/0xde4 [qla2x00tgt]

Therefore, call scst_unregister_target() only from qlt_del_vtarget()
This commit is contained in:
Gleb Chesnokov
2022-05-12 17:36:34 +03:00
parent fa4cb77a87
commit 4401a3e064

View File

@@ -2175,7 +2175,6 @@ static void __exit sqa_exit(void)
vha->host_no);
qlt_stop_phase1(sqa_tgt->qla_tgt);
scst_unregister_target(sqa_tgt->scst_tgt);
qlt_del_vtarget(wwn_to_u64(vha->port_name));
}
}