summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libiscsi.c
diff options
context:
space:
mode:
authorMike Christie <michael.christie@oracle.com>2021-05-25 13:18:08 -0500
committerMartin K. Petersen <martin.petersen@oracle.com>2021-06-02 01:28:21 -0400
commitf6f9645744702f4690e884e86523a7ce1895e221 (patch)
treea4af66f807ebe1f9720b14e32ce1336159d84bb8 /drivers/scsi/libiscsi.c
parentbdd4aad7ff92ae39c2e93c415bb6761cb8b584da (diff)
downloadlinux-f6f9645744702f4690e884e86523a7ce1895e221.tar.gz
linux-f6f9645744702f4690e884e86523a7ce1895e221.tar.bz2
linux-f6f9645744702f4690e884e86523a7ce1895e221.zip
scsi: iscsi: Fix completion check during abort races
We have a ref to the task being aborted, so SCp.ptr will never be NULL. We need to use iscsi_task_is_completed to check for the completed state. Link: https://lore.kernel.org/r/20210525181821.7617-16-michael.christie@oracle.com Reviewed-by: Lee Duncan <lduncan@suse.com> Signed-off-by: Mike Christie <michael.christie@oracle.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/libiscsi.c')
-rw-r--r--drivers/scsi/libiscsi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index 94abb093098d..8222db4f8fef 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -2338,7 +2338,7 @@ int iscsi_eh_abort(struct scsi_cmnd *sc)
iscsi_conn_failure(conn, ISCSI_ERR_SCSI_EH_SESSION_RST);
goto failed_unlocked;
case TMF_NOT_FOUND:
- if (!sc->SCp.ptr) {
+ if (iscsi_task_is_completed(task)) {
session->tmf_state = TMF_INITIAL;
memset(hdr, 0, sizeof(*hdr));
/* task completed before tmf abort response */