aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicholas Bellinger <nab@linux-iscsi.org>2012-03-09 23:45:38 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-04-02 09:27:11 -0700
commitbf8109a3b01b5c64e0ec4b11fa020abca8d00223 (patch)
treedc5b0af6470d37cd3870fcccd7d48ea3c85e2a0b
parent6ee80c0330b0413b9daa9e2aa9142554de290bdc (diff)
downloadkernel_samsung_crespo-bf8109a3b01b5c64e0ec4b11fa020abca8d00223.zip
kernel_samsung_crespo-bf8109a3b01b5c64e0ec4b11fa020abca8d00223.tar.gz
kernel_samsung_crespo-bf8109a3b01b5c64e0ec4b11fa020abca8d00223.tar.bz2
tcm_fc: Fix fc_exch memory leak in ft_send_resp_status
commit 031ed4d565b31880a4136bb7366bc89f5b1dba7d upstream. 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> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.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 b2a1067..3c3fa84 100644
--- a/drivers/target/tcm_fc/tfc_cmd.c
+++ b/drivers/target/tcm_fc/tfc_cmd.c
@@ -371,10 +371,12 @@ static void ft_send_resp_status(struct fc_lport *lport,
fc_fill_reply_hdr(fp, rx_fp, FC_RCTL_DD_CMD_STATUS, 0);
sp = fr_seq(fp);
- if (sp)
+ if (sp) {
lport->tt.seq_send(lport, sp, fp);
- else
+ lport->tt.exch_done(sp);
+ } else {
lport->tt.frame_send(lport, fp);
+ }
}
/*