[PATCH] target: Fix target_submit_cmd() exception path kref_put leak

1 view
Skip to first unread message

Nicholas A. Bellinger

unread,
Jan 20, 2012, 10:12:21 PM1/20/12
to target-devel, Nicholas Bellinger, Roland Dreier
From: Nicholas Bellinger <n...@linux-iscsi.org>

This patch fixes a bug in target_submit_cmd() where the direct call
to transport_send_check_condition_and_sense() was not calling the
final target_put_sess_cmd() release callback.

Use proper transport_generic_request_failure() wrapper instead around
transport_send_check_condition_and_sense() to handle kref_put() along
with potential internal queue full response processing.

Reported-by: Roland Dreier <rol...@purestorage.com>
Cc: Roland Dreier <rol...@purestorage.com>
Signed-off-by: Nicholas Bellinger <n...@linux-iscsi.org>
---
drivers/target/target_core_transport.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
index fa5a6cf..72824f1 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -1687,8 +1687,7 @@ void target_submit_cmd(struct se_cmd *se_cmd, struct se_session *se_sess,
return;

out_check_cond:
- transport_send_check_condition_and_sense(se_cmd,
- se_cmd->scsi_sense_reason, 0);
+ transport_generic_request_failure(se_cmd);
}
EXPORT_SYMBOL(target_submit_cmd);

--
1.7.2.5

Reply all
Reply to author
Forward
0 new messages