From: Daniil Dulov <d.dulov@aladdin.ru>
To: Nilesh Javali <njavali@marvell.com>,
<GR-QLogic-Storage-Upstream@marvell.com>,
"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Daniil Dulov <d.dulov@aladdin.ru>,
Dmitry Bogdanov <d.bogdanov@yadro.com>,
Tony Battersby <tonyb@cybernetics.com>,
<linux-scsi@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<lvc-project@linuxtesting.org>, <stable@vger.kernel.org>
Subject: [PATCH] scsi: qla2xxx: Check if target mode enabled in case of task management commands
Date: Thu, 26 Mar 2026 12:42:49 +0300 [thread overview]
Message-ID: <20260326094249.1366353-1-d.dulov@aladdin.ru> (raw)
TYPE_TGT_TMCMD are not being skipped now, but tgt_ops are dereferenced
in qlt_free_ul_cmd() without checking if target mode is enabled. However,
it is possible that commands requiring target mode to be enabled are
received while target mode is disabled as it is seen in TYPE_TGT_CMD case.
To fix the issue check if target mode is enabled in TYPE_TGT_TMCMD
case as well.
Fixes: d46c69a087aa ("scsi: qla2xxx: Clear cmds after chip reset")
Cc: stable@vger.kernel.org
Signed-off-by: Daniil Dulov <d.dulov@aladdin.ru>
---
drivers/scsi/qla2xxx/qla_os.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 72b1c28e4dae..e81ef3629aaa 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -1890,6 +1890,13 @@ __qla2x00_abort_all_cmds(struct qla_qpair *qp, int res)
}
break;
case TYPE_TGT_TMCMD:
+ if (!vha->hw->tgt.tgt_ops || !tgt ||
+ qla_ini_mode_enabled(vha)) {
+ ql_dbg(ql_dbg_tgt_mgt, vha, 0xf004,
+ "HOST-ABORT-HNDLR: dpc_flags=%lx. Target mode disabled\n",
+ vha->dpc_flags);
+ continue;
+ }
/*
* Currently, only ABTS response gets on the
* outstanding_cmds[]
--
2.34.1
next reply other threads:[~2026-03-26 9:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-26 9:42 Daniil Dulov [this message]
2026-03-26 12:16 ` [PATCH] scsi: qla2xxx: Check if target mode enabled in case of task management commands Dmitry Bogdanov
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=20260326094249.1366353-1-d.dulov@aladdin.ru \
--to=d.dulov@aladdin.ru \
--cc=GR-QLogic-Storage-Upstream@marvell.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=d.bogdanov@yadro.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=lvc-project@linuxtesting.org \
--cc=martin.petersen@oracle.com \
--cc=njavali@marvell.com \
--cc=stable@vger.kernel.org \
--cc=tonyb@cybernetics.com \
/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