Commit dd9c4eff authored by Himanshu Madhani's avatar Himanshu Madhani Committed by Christoph Hellwig

qla2xxx: fix crash due to task mgmt cmd type

tcm_qla2xxx_get_task_tag incorrectly assume command is
qla_tgt_cmd.  Add check to see if it's a scsi cmd or
task mgmt command.
Signed-off-by: default avatarQuinn Tran <quinn.tran@qlogic.com>
Signed-off-by: default avatarSaurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent d29fb736
...@@ -515,8 +515,13 @@ static void tcm_qla2xxx_set_default_node_attrs(struct se_node_acl *nacl) ...@@ -515,8 +515,13 @@ static void tcm_qla2xxx_set_default_node_attrs(struct se_node_acl *nacl)
static u32 tcm_qla2xxx_get_task_tag(struct se_cmd *se_cmd) static u32 tcm_qla2xxx_get_task_tag(struct se_cmd *se_cmd)
{ {
struct qla_tgt_cmd *cmd = container_of(se_cmd, struct qla_tgt_cmd *cmd;
struct qla_tgt_cmd, se_cmd);
/* check for task mgmt cmd */
if (se_cmd->se_cmd_flags & SCF_SCSI_TMR_CDB)
return 0xffffffff;
cmd = container_of(se_cmd, struct qla_tgt_cmd, se_cmd);
return cmd->tag; return cmd->tag;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment