target: Fix reference leak in target_get_sess_cmd() error path
authorBart Van Assche <bart.vanassche@sandisk.com>
Wed, 18 Feb 2015 14:33:58 +0000 (15:33 +0100)
committerNicholas Bellinger <nab@linux-iscsi.org>
Fri, 20 Mar 2015 06:26:31 +0000 (23:26 -0700)
commit7544e597343e2166daba3f32e4708533aa53c233
treec3313d9f42ab0eeeca72de76d67283320444940a
parent2f450cc1fbe9713f79b217e61ab204e263723ead
target: Fix reference leak in target_get_sess_cmd() error path

This patch fixes a se_cmd->cmd_kref leak buf when se_sess->sess_tearing_down
is true within target_get_sess_cmd() submission path code.

This se_cmd reference leak can occur during active session shutdown when
ack_kref=1 is passed by target_submit_cmd_[map_sgls,tmr]() callers.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: <stable@vger.kernel.org> # 3.6+
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/target_core_transport.c