]> git.hungrycats.org Git - linux/commitdiff
scsi: qla2xxx: Make qla2x00_abort_srb() again decrease the sp reference count
authorBart Van Assche <bvanassche@acm.org>
Fri, 9 Aug 2019 03:01:22 +0000 (20:01 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 17 Dec 2019 19:08:25 +0000 (20:08 +0100)
[ Upstream commit d2d2b5a5741d317bed1fa38211f1f3b142d8cf7a ]

Since qla2x00_abort_srb() starts with increasing the reference count of
@sp, decrease that same reference count before returning.

Cc: Himanshu Madhani <hmadhani@marvell.com>
Fixes: 219d27d7147e ("scsi: qla2xxx: Fix race conditions in the code for aborting SCSI commands") # v5.2.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Tested-by: Himanshu Madhani <hmadhani@marvell.com>
Reviewed-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/scsi/qla2xxx/qla_os.c

index ef75897b27132ce20a7ba514d980f65f5f3607d1..82f6ae4dcfc0beb70e2e12553f27bef269178579 100644 (file)
@@ -1751,6 +1751,8 @@ static void qla2x00_abort_srb(struct qla_qpair *qp, srb_t *sp, const int res,
                spin_lock_irqsave(qp->qp_lock_ptr, *flags);
                sp->comp = NULL;
        }
+
+       atomic_dec(&sp->ref_count);
 }
 
 static void