]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
scsi: qla2xxx: Avoid double completion of abort command
authorBen Hutchings <ben.hutchings@codethink.co.uk>
Tue, 20 Mar 2018 21:05:48 +0000 (21:05 +0000)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:55:02 +0000 (19:55 -0600)
BugLink: https://bugs.launchpad.net/bugs/1836654
[ Upstream commit 3a9910d7b686546dcc9986e790af17e148f1c888 ]

qla2x00_tmf_sp_done() now deletes the timer that will run
qla2x00_tmf_iocb_timeout(), but doesn't check whether the timer already
expired.  Check the return value from del_timer() to avoid calling
complete() a second time.

Fixes: 4440e46d5db7 ("[SCSI] qla2xxx: Add IOCB Abort command asynchronous ...")
Fixes: 1514839b3664 ("scsi: qla2xxx: Fix NULL pointer crash due to active ...")
Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Acked-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/scsi/qla2xxx/qla_init.c

index 865fc617e3aab8f673a3ff32fc8f6d345ba62300..aacc9abc412425e430c28c76869d60512f8c0601 100644 (file)
@@ -1374,8 +1374,8 @@ qla24xx_abort_sp_done(void *ptr, int res)
        srb_t *sp = ptr;
        struct srb_iocb *abt = &sp->u.iocb_cmd;
 
-       del_timer(&sp->u.iocb_cmd.timer);
-       complete(&abt->u.abt.comp);
+       if (del_timer(&sp->u.iocb_cmd.timer))
+               complete(&abt->u.abt.comp);
 }
 
 int