aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorNicholas Bellinger <nab@linux-iscsi.org>2012-02-25 04:43:04 -0500
committerNicholas Bellinger <nab@linux-iscsi.org>2012-02-25 21:38:39 -0500
commit00ad4c4e81ba8bfcc52c42ec9d72ff84a081fb82 (patch)
treef77fd50761bf224937656145dbae20a036fd3552 /drivers
parentc7042cae58c13970f39c0820a3aab2a13dda9fe1 (diff)
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: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/target/tcm_fc/tfc_cmd.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/target/tcm_fc/tfc_cmd.c b/drivers/target/tcm_fc/tfc_cmd.c
index ed69c0deb102..be3319af5d8b 100644
--- a/drivers/target/tcm_fc/tfc_cmd.c
+++ b/drivers/target/tcm_fc/tfc_cmd.c
@@ -354,6 +354,7 @@ static void ft_send_resp_code_and_free(struct ft_cmd *cmd,
354static void ft_send_tm(struct ft_cmd *cmd) 354static void ft_send_tm(struct ft_cmd *cmd)
355{ 355{
356 struct fcp_cmnd *fcp; 356 struct fcp_cmnd *fcp;
357 int rc;
357 u8 tm_func; 358 u8 tm_func;
358 359
359 fcp = fc_frame_payload_get(cmd->req_frame, sizeof(*fcp)); 360 fcp = fc_frame_payload_get(cmd->req_frame, sizeof(*fcp));
@@ -384,9 +385,11 @@ static void ft_send_tm(struct ft_cmd *cmd)
384 return; 385 return;
385 } 386 }
386 387
387 target_submit_tmr(&cmd->se_cmd, cmd->sess->se_sess, 388 rc = target_submit_tmr(&cmd->se_cmd, cmd->sess->se_sess,
388 &cmd->ft_sense_buffer[0], scsilun_to_int(&fcp->fc_lun), 389 &cmd->ft_sense_buffer[0], scsilun_to_int(&fcp->fc_lun),
389 cmd, tm_func, 0); 390 cmd, tm_func, 0);
391 if (rc < 0)
392 ft_send_resp_code_and_free(cmd, FCP_TMF_FAILED);
390} 393}
391 394
392/* 395/*