mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
scsi: tcmu: fix use after free
[ Upstream commit40d883b091] Fixes:a94a2572b9("scsi: tcmu: avoid cmd/qfull timers updated whenever a new cmd comes") Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Cc: Mike Christie <mchristi@redhat.com> Signed-off-by: Xiubo Li <xiubli@redhat.com> Reviewed-by: Mike Christie <mchristi@redhat.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
04096b3bea
commit
e2851c3ee0
@@ -1317,12 +1317,13 @@ static int tcmu_check_expired_cmd(int id, void *p, void *data)
|
||||
* target_complete_cmd will translate this to LUN COMM FAILURE
|
||||
*/
|
||||
scsi_status = SAM_STAT_CHECK_CONDITION;
|
||||
list_del_init(&cmd->queue_entry);
|
||||
} else {
|
||||
list_del_init(&cmd->queue_entry);
|
||||
idr_remove(&udev->commands, id);
|
||||
tcmu_free_cmd(cmd);
|
||||
scsi_status = SAM_STAT_TASK_SET_FULL;
|
||||
}
|
||||
list_del_init(&cmd->queue_entry);
|
||||
|
||||
pr_debug("Timing out cmd %u on dev %s that is %s.\n",
|
||||
id, udev->name, is_running ? "inflight" : "queued");
|
||||
|
||||
Reference in New Issue
Block a user