blob: c4c70c230095aafa52f940d02a4baa344a2362b2 [file] [log] [blame]
From 852ac57f6c7749289ad90b6d76967b6eb08208a7 Mon Sep 17 00:00:00 2001
From: Bart Van Assche <bvanassche@acm.org>
Date: Thu, 8 Aug 2019 20:01:22 -0700
Subject: [PATCH] scsi: qla2xxx: Make qla2x00_abort_srb() again decrease the sp
reference count
commit d2d2b5a5741d317bed1fa38211f1f3b142d8cf7a upstream.
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: Paul Gortmaker <paul.gortmaker@windriver.com>
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index f404c2790029..a288ae1f43ea 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -1746,6 +1746,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
--
2.27.0