diff options
Diffstat (limited to 'drivers/scsi/libiscsi.c')
-rw-r--r-- | drivers/scsi/libiscsi.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c index 12b5c1800740..c542d0e95e68 100644 --- a/drivers/scsi/libiscsi.c +++ b/drivers/scsi/libiscsi.c | |||
@@ -213,12 +213,8 @@ static void iscsi_get_ctask(struct iscsi_cmd_task *ctask) | |||
213 | 213 | ||
214 | static void __iscsi_put_ctask(struct iscsi_cmd_task *ctask) | 214 | static void __iscsi_put_ctask(struct iscsi_cmd_task *ctask) |
215 | { | 215 | { |
216 | struct iscsi_conn *conn = ctask->conn; | 216 | if (atomic_dec_and_test(&ctask->refcount)) |
217 | |||
218 | if (atomic_dec_and_test(&ctask->refcount)) { | ||
219 | conn->session->tt->cleanup_cmd_task(conn, ctask); | ||
220 | iscsi_complete_command(ctask); | 217 | iscsi_complete_command(ctask); |
221 | } | ||
222 | } | 218 | } |
223 | 219 | ||
224 | static void iscsi_put_ctask(struct iscsi_cmd_task *ctask) | 220 | static void iscsi_put_ctask(struct iscsi_cmd_task *ctask) |
@@ -1129,10 +1125,13 @@ static void fail_command(struct iscsi_conn *conn, struct iscsi_cmd_task *ctask, | |||
1129 | sc = ctask->sc; | 1125 | sc = ctask->sc; |
1130 | if (!sc) | 1126 | if (!sc) |
1131 | return; | 1127 | return; |
1128 | |||
1129 | conn->session->tt->cleanup_cmd_task(conn, ctask); | ||
1132 | iscsi_ctask_mtask_cleanup(ctask); | 1130 | iscsi_ctask_mtask_cleanup(ctask); |
1133 | 1131 | ||
1134 | sc->result = err; | 1132 | sc->result = err; |
1135 | sc->resid = sc->request_bufflen; | 1133 | sc->resid = sc->request_bufflen; |
1134 | /* release ref from queuecommand */ | ||
1136 | __iscsi_put_ctask(ctask); | 1135 | __iscsi_put_ctask(ctask); |
1137 | } | 1136 | } |
1138 | 1137 | ||