diff options
-rw-r--r-- | drivers/target/target_core_user.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/target/target_core_user.c b/drivers/target/target_core_user.c index c34c88ef3319..5831e0eecea1 100644 --- a/drivers/target/target_core_user.c +++ b/drivers/target/target_core_user.c | |||
@@ -1317,12 +1317,13 @@ static int tcmu_check_expired_cmd(int id, void *p, void *data) | |||
1317 | * target_complete_cmd will translate this to LUN COMM FAILURE | 1317 | * target_complete_cmd will translate this to LUN COMM FAILURE |
1318 | */ | 1318 | */ |
1319 | scsi_status = SAM_STAT_CHECK_CONDITION; | 1319 | scsi_status = SAM_STAT_CHECK_CONDITION; |
1320 | list_del_init(&cmd->queue_entry); | ||
1320 | } else { | 1321 | } else { |
1322 | list_del_init(&cmd->queue_entry); | ||
1321 | idr_remove(&udev->commands, id); | 1323 | idr_remove(&udev->commands, id); |
1322 | tcmu_free_cmd(cmd); | 1324 | tcmu_free_cmd(cmd); |
1323 | scsi_status = SAM_STAT_TASK_SET_FULL; | 1325 | scsi_status = SAM_STAT_TASK_SET_FULL; |
1324 | } | 1326 | } |
1325 | list_del_init(&cmd->queue_entry); | ||
1326 | 1327 | ||
1327 | pr_debug("Timing out cmd %u on dev %s that is %s.\n", | 1328 | pr_debug("Timing out cmd %u on dev %s that is %s.\n", |
1328 | id, udev->name, is_running ? "inflight" : "queued"); | 1329 | id, udev->name, is_running ? "inflight" : "queued"); |