aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicholas Bellinger <nab@linux-iscsi.org>2012-03-10 02:45:38 -0500
committerNicholas Bellinger <nab@linux-iscsi.org>2012-03-10 17:42:56 -0500
commit031ed4d565b31880a4136bb7366bc89f5b1dba7d (patch)
treee905871a0c6706ca16f9df33dfaacebbf33a4ca3
parentc7ec05c82bfd6acf1fd800d628591500805f3179 (diff)
tcm_fc: Fix fc_exch memory leak in ft_send_resp_status
This patch fixes a bug in tcm_fc where fc_exch memory from fc_exch_mgr->ep_pool is currently being leaked by ft_send_resp_status() usage. Following current code in ft_queue_status() response path, using lport->tt.seq_send() needs to be followed by a lport->tt.exch_done() in order to release fc_exch memory back into libfc_em kmem_cache. ft_send_resp_status() code is currently used in pre submit se_cmd ft_send_work() error exceptions, TM request setup exceptions, and main TM response callback path in ft_queue_tm_resp(). This bugfix addresses the leak in these cases. Cc: Mark D Rustad <mark.d.rustad@intel.com> Cc: Kiran Patil <kiran.patil@intel.com> Cc: Robert Love <robert.w.love@intel.com> Cc: Andy Grover <agrover@redhat.com> Cc: stable@vger.kernel.org Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
-rw-r--r--drivers/target/tcm_fc/tfc_cmd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/target/tcm_fc/tfc_cmd.c b/drivers/target/tcm_fc/tfc_cmd.c
index b831461156b..62dec9715ce 100644
--- a/drivers/target/tcm_fc/tfc_cmd.c
+++ b/drivers/target/tcm_fc/tfc_cmd.c
@@ -315,10 +315,12 @@ static void ft_send_resp_status(struct fc_lport *lport,
315 315
316 fc_fill_reply_hdr(fp, rx_fp, FC_RCTL_DD_CMD_STATUS, 0); 316 fc_fill_reply_hdr(fp, rx_fp, FC_RCTL_DD_CMD_STATUS, 0);
317 sp = fr_seq(fp); 317 sp = fr_seq(fp);
318 if (sp) 318 if (sp) {
319 lport->tt.seq_send(lport, sp, fp); 319 lport->tt.seq_send(lport, sp, fp);
320 else 320 lport->tt.exch_done(sp);
321 } else {
321 lport->tt.frame_send(lport, fp); 322 lport->tt.frame_send(lport, fp);
323 }
322} 324}
323 325
324/* 326/*