aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libiscsi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/libiscsi.c')
-rw-r--r--drivers/scsi/libiscsi.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index b17081bed128..4461317e617f 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -248,13 +248,16 @@ static int iscsi_prep_scsi_cmd_pdu(struct iscsi_cmd_task *ctask)
248 */ 248 */
249static void iscsi_complete_command(struct iscsi_cmd_task *ctask) 249static void iscsi_complete_command(struct iscsi_cmd_task *ctask)
250{ 250{
251 struct iscsi_session *session = ctask->conn->session; 251 struct iscsi_conn *conn = ctask->conn;
252 struct iscsi_session *session = conn->session;
252 struct scsi_cmnd *sc = ctask->sc; 253 struct scsi_cmnd *sc = ctask->sc;
253 254
254 ctask->state = ISCSI_TASK_COMPLETED; 255 ctask->state = ISCSI_TASK_COMPLETED;
255 ctask->sc = NULL; 256 ctask->sc = NULL;
256 /* SCSI eh reuses commands to verify us */ 257 /* SCSI eh reuses commands to verify us */
257 sc->SCp.ptr = NULL; 258 sc->SCp.ptr = NULL;
259 if (conn->ctask == ctask)
260 conn->ctask = NULL;
258 list_del_init(&ctask->running); 261 list_del_init(&ctask->running);
259 __kfifo_put(session->cmdpool.queue, (void*)&ctask, sizeof(void*)); 262 __kfifo_put(session->cmdpool.queue, (void*)&ctask, sizeof(void*));
260 sc->scsi_done(sc); 263 sc->scsi_done(sc);