tcm_fc: Handle target_submit_tmr allocation failure

This patch makes ft_send_tm() handle target_submit_tmr() allocation failures
via an ft_send_resp_code_and_free() w/ FCP_TMF_FAILED status.

Cc: Andy Grover <agrover@redhat.com>
Cc: Kiran Patil <kiran.patil@intel.com>
Cc: Arun Easi <arun.easi@qlogic.com>
Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
上级 c7042cae
...@@ -354,6 +354,7 @@ static void ft_send_resp_code_and_free(struct ft_cmd *cmd, ...@@ -354,6 +354,7 @@ static void ft_send_resp_code_and_free(struct ft_cmd *cmd,
static void ft_send_tm(struct ft_cmd *cmd) static void ft_send_tm(struct ft_cmd *cmd)
{ {
struct fcp_cmnd *fcp; struct fcp_cmnd *fcp;
int rc;
u8 tm_func; u8 tm_func;
fcp = fc_frame_payload_get(cmd->req_frame, sizeof(*fcp)); fcp = fc_frame_payload_get(cmd->req_frame, sizeof(*fcp));
...@@ -384,9 +385,11 @@ static void ft_send_tm(struct ft_cmd *cmd) ...@@ -384,9 +385,11 @@ static void ft_send_tm(struct ft_cmd *cmd)
return; return;
} }
target_submit_tmr(&cmd->se_cmd, cmd->sess->se_sess, rc = target_submit_tmr(&cmd->se_cmd, cmd->sess->se_sess,
&cmd->ft_sense_buffer[0], scsilun_to_int(&fcp->fc_lun), &cmd->ft_sense_buffer[0], scsilun_to_int(&fcp->fc_lun),
cmd, tm_func, 0); cmd, tm_func, 0);
if (rc < 0)
ft_send_resp_code_and_free(cmd, FCP_TMF_FAILED);
} }
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
新手
引导
客服 返回
顶部