diff options
| -rw-r--r-- | drivers/target/iscsi/iscsi_target.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c index 91fbada7cdc2..541f66a875fc 100644 --- a/drivers/target/iscsi/iscsi_target.c +++ b/drivers/target/iscsi/iscsi_target.c | |||
| @@ -833,6 +833,7 @@ static int iscsit_add_reject_from_cmd( | |||
| 833 | unsigned char *buf) | 833 | unsigned char *buf) |
| 834 | { | 834 | { |
| 835 | struct iscsi_conn *conn; | 835 | struct iscsi_conn *conn; |
| 836 | const bool do_put = cmd->se_cmd.se_tfo != NULL; | ||
| 836 | 837 | ||
| 837 | if (!cmd->conn) { | 838 | if (!cmd->conn) { |
| 838 | pr_err("cmd->conn is NULL for ITT: 0x%08x\n", | 839 | pr_err("cmd->conn is NULL for ITT: 0x%08x\n", |
| @@ -863,7 +864,7 @@ static int iscsit_add_reject_from_cmd( | |||
| 863 | * Perform the kref_put now if se_cmd has already been setup by | 864 | * Perform the kref_put now if se_cmd has already been setup by |
| 864 | * scsit_setup_scsi_cmd() | 865 | * scsit_setup_scsi_cmd() |
| 865 | */ | 866 | */ |
| 866 | if (cmd->se_cmd.se_tfo != NULL) { | 867 | if (do_put) { |
| 867 | pr_debug("iscsi reject: calling target_put_sess_cmd >>>>>>\n"); | 868 | pr_debug("iscsi reject: calling target_put_sess_cmd >>>>>>\n"); |
| 868 | target_put_sess_cmd(&cmd->se_cmd); | 869 | target_put_sess_cmd(&cmd->se_cmd); |
| 869 | } | 870 | } |
