From: Quinn Tran Date: Tue, 11 Sep 2018 17:18:19 +0000 (-0700) Subject: scsi: qla2xxx: Fix early srb free on abort X-Git-Tag: v5.4-rc1~2267^2~207 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8235f4b5aeba868739f6e12a51ad92689e3f78ef;p=platform%2Fkernel%2Flinux-rpi.git scsi: qla2xxx: Fix early srb free on abort 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 Signed-off-by: Himanshu Madhani Signed-off-by: Martin K. Petersen --- diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 2e836d1..0575210 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -1850,6 +1850,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: