From c8a75afbf72ee4c16dad5339f55f62095879f207 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Thu, 26 Jul 2018 10:20:37 -0700 Subject: Revert "scsi: target/iscsi: Reduce number of __iscsit_free_cmd() callers" The cxgbit driver expects that __iscsit_free_cmd() is called before the target core frees the command page list. Since this patch breaks the cxgbit driver, revert it. Reported-by: Varun Prakash Fixes: ed88f055788a ("scsi: target/iscsi: Reduce number of __iscsit_free_cmd() callers") Signed-off-by: Bart Van Assche Cc: Varun Prakash Cc: Mike Christie Cc: Hannes Reinecke Cc: Christoph Hellwig Reviewed-by: Mike Christie Signed-off-by: Martin K. Petersen --- drivers/target/iscsi/iscsi_target_util.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'drivers/target/iscsi/iscsi_target_util.c') diff --git a/drivers/target/iscsi/iscsi_target_util.c b/drivers/target/iscsi/iscsi_target_util.c index 5a645b5f1eb4..8cfcf9033507 100644 --- a/drivers/target/iscsi/iscsi_target_util.c +++ b/drivers/target/iscsi/iscsi_target_util.c @@ -772,8 +772,10 @@ void iscsit_free_cmd(struct iscsi_cmd *cmd, bool shutdown) __iscsit_free_cmd(cmd, shutdown); if (se_cmd) { rc = transport_generic_free_cmd(se_cmd, shutdown); - if (!rc && shutdown && se_cmd->se_sess) + if (!rc && shutdown && se_cmd->se_sess) { + __iscsit_free_cmd(cmd, shutdown); target_put_sess_cmd(se_cmd); + } } else { iscsit_release_cmd(cmd); } -- cgit v1.2.3