diff options
author | Quinn Tran <quinn.tran@cavium.com> | 2018-09-11 10:18:19 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-11-21 09:19:13 +0100 |
commit | c97c9cfb4d80f8cea22feab370d80d7b403e878b (patch) | |
tree | 50593e4b7edb1aad76741d81485efe4c339c726d | |
parent | 731fe8aaa87cb4977e9a4c34a6015961b17a18d3 (diff) | |
download | linux-stable-c97c9cfb4d80f8cea22feab370d80d7b403e878b.tar.gz linux-stable-c97c9cfb4d80f8cea22feab370d80d7b403e878b.tar.bz2 linux-stable-c97c9cfb4d80f8cea22feab370d80d7b403e878b.zip |
scsi: qla2xxx: Fix early srb free on abort
commit 8235f4b5aeba868739f6e12a51ad92689e3f78ef upstream.
Task abort can take 2 paths: 1) serial/synchronous abort where the calling
thread will put to sleep, wait for completion and free cmd resource. 2) async
abort where the cmd free will be free by the completion thread. For path 2,
driver is freeing the SRB too early.
Fixes: f6145e86d21f ("scsi: qla2xxx: Fix race between switch cmd completion and timeout")
Cc: stable@vger.kernel.org # 4.19
Signed-off-by: Quinn Tran <quinn.tran@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/scsi/qla2xxx/qla_init.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 4686fb5f26aa..0d86044e69eb 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -1788,6 +1788,8 @@ qla24xx_async_abort_cmd(srb_t *cmd_sp, bool wait) wait_for_completion(&abt_iocb->u.abt.comp); rval = abt_iocb->u.abt.comp_status == CS_COMPLETE ? QLA_SUCCESS : QLA_FUNCTION_FAILED; + } else { + goto done; } done_free_sp: |