Skip to content

Commit

Permalink
tcm_fc: Handle target_submit_tmr allocation failure
Browse files Browse the repository at this point in the history
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: Nicholas Bellinger <nab@linux-iscsi.org>
  • Loading branch information
Nicholas Bellinger committed Feb 26, 2012
1 parent c7042ca commit 00ad4c4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/target/tcm_fc/tfc_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
struct fcp_cmnd *fcp;
int rc;
u8 tm_func;

fcp = fc_frame_payload_get(cmd->req_frame, sizeof(*fcp));
Expand Down Expand Up @@ -384,9 +385,11 @@ static void ft_send_tm(struct ft_cmd *cmd)
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, tm_func, 0);
if (rc < 0)
ft_send_resp_code_and_free(cmd, FCP_TMF_FAILED);
}

/*
Expand Down

0 comments on commit 00ad4c4

Please sign in to comment.