public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Gleb Chesnokov <gleb.chesnokov@scst.dev>
To: linux-scsi@vger.kernel.org
Subject: [PATCH 2/2] qla2xxx: Initialize vha->unknown_atio_[list, work] for NPIV hosts
Date: Tue, 15 Nov 2022 12:38:08 +0300	[thread overview]
Message-ID: <376c89a2-a9ac-bcf9-bf0f-dfe89a02fd4b@scst.dev> (raw)

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().

Signed-off-by: Gleb Chesnokov <gleb.chesnokov@scst.dev>
---
  drivers/scsi/qla2xxx/qla_target.c | 3 +++
  1 file changed, 3 insertions(+)

diff --git a/drivers/scsi/qla2xxx/qla_target.c 
b/drivers/scsi/qla2xxx/qla_target.c
index bb754a950802..548f22705ddc 100644
--- a/drivers/scsi/qla2xxx/qla_target.c
+++ b/drivers/scsi/qla2xxx/qla_target.c
@@ -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);

  	/*
-- 
2.38.1

             reply	other threads:[~2022-11-15  9:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-15  9:38 Gleb Chesnokov [this message]
2022-11-26  0:36 ` [PATCH 2/2] qla2xxx: Initialize vha->unknown_atio_[list, work] for NPIV hosts Martin K. Petersen
2022-12-01  3:45 ` Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=376c89a2-a9ac-bcf9-bf0f-dfe89a02fd4b@scst.dev \
    --to=gleb.chesnokov@scst.dev \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox