]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
tcm_fc: Fix fc_exch memory leak in ft_send_resp_status
authorNicholas Bellinger <nab@linux-iscsi.org>
Sat, 10 Mar 2012 07:45:38 +0000 (23:45 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 2 Apr 2012 17:31:55 +0000 (10:31 -0700)
commit72ab3d92feff3cf388ad74395b1f49050fa9186d
treedf4b5c548373ef69376e423d3ae712d0e0d0a6c2
parenta8a9b9379344c4d1d67877d6798ea0a3ca46d066
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>
drivers/target/tcm_fc/tfc_cmd.c