From 8cd13de7f87dda8c8d6e34f2d22d6c595c468bc2 Mon Sep 17 00:00:00 2001 From: Gleb Chesnokov Date: Thu, 15 Dec 2022 10:47:41 +0300 Subject: [PATCH] qla2x00t-32gbit: 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 qlt_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(). Signed-off-by: Gleb Chesnokov Link: https://lore.kernel.org/r/376c89a2-a9ac-bcf9-bf0f-dfe89a02fd4b@scst.dev Signed-off-by: Martin K. Petersen [ commit 95da5e58172c upstream ] Fixes: https://github.com/SCST-project/scst/issues/56 --- qla2x00t-32gbit/qla_target.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qla2x00t-32gbit/qla_target.c b/qla2x00t-32gbit/qla_target.c index 383cd931b..02bb0c1a0 100644 --- a/qla2x00t-32gbit/qla_target.c +++ b/qla2x00t-32gbit/qla_target.c @@ -6809,6 +6809,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); /*