Skip to contentSkip to conversation

qla2xxx: Initialize vha->unknown_atio_[list, work] for NPIV hosts

PATCH Applied Gleb Chesnokov 2 participants 3 messages Nov 15, 2022 – Dec 1, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 qla2xxx: Initialize vha->unknown_atio_[list, work] for NPIV hosts

Initialization of vha->unknown_atio_list and vha->unknown_atio_work only happens for base_vha in qla_probe_one_stage1(). But there is no initialization for NPIV hosts that are created in qla24xx_vport_create().

This causes a crash when trying to access these NPIV host fields.

Fix this by adding initialization to qla_vport_create().

---
 drivers/scsi/qla2xxx/qla_target.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/scsi/qla2xxx/qla_target.c +3 -0
index bb754a950802..548f22705ddc 100644
@@ -6741,6 +6741,9 @@ qlt_vport_create(struct scsi_qla_host *vha, struct qla_hw_data *ha)
 	mutex_init(&vha->vha_tgt.tgt_mutex);
 	mutex_init(&vha->vha_tgt.tgt_host_action_mutex);
 
+	INIT_LIST_HEAD(&vha->unknown_atio_list);
+	INIT_DELAYED_WORK(&vha->unknown_atio_work, qlt_unknown_atio_work_fn);
+
 	qlt_clear_mode(vha);
 
 	/*
Signature · 1 line
2.38.1
#1 lore raw

Gleb,

Quoted 4 lines

Initialization of vha->unknown_atio_list and vha->unknown_atio_work only happens for base_vha in qla_probe_one_stage1(). But there is no initialization for NPIV hosts that are created in qla24xx_vport_create().

Applied to 6.2/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering
#2 lore raw
In reply to Gleb Chesnokov
Quoted 9 lines · Gleb Chesnokov

Initialization of vha->unknown_atio_list and vha->unknown_atio_work only happens for base_vha in qla_probe_one_stage1(). But there is no initialization for NPIV hosts that are created in qla24xx_vport_create().

This causes a crash when trying to access these NPIV host fields.

Fix this by adding initialization to qla_vport_create().

[...]

Applied to 6.2/scsi-queue, thanks!

[2/2] qla2xxx: Initialize vha->unknown_atio_[list, work] for NPIV hosts

      https://git.kernel.org/mkp/scsi/c/95da5e58172c
Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering