Skip to content
Commit d712d3fb authored by Igor Pylypiv's avatar Igor Pylypiv Committed by Martin K. Petersen
Browse files

scsi: pm80xx: Fix TMF task completion race condition

The TMF timeout timer may trigger at the same time when the response from a
controller is being handled. When this happens the SAS task may get freed
before the response processing is finished.

Fix this by calling complete() only when SAS_TASK_STATE_DONE is not set.

A similar race condition was fixed in commit b90cd6f2 ("scsi: libsas:
fix a race condition when smp task timeout")

Link: https://lore.kernel.org/r/20210707185945.35559-1-ipylypiv@google.com


Reviewed-by: default avatarVishakha Channapattan <vishakhavc@google.com>
Acked-by: default avatarJack Wang <jinpu.wang@ionos.com>
Signed-off-by: default avatarIgor Pylypiv <ipylypiv@google.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent a47fa413
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment