From: Bart Van Assche <bvanassche@acm.org>
Date: Thu, 8 Aug 2019 20:01:22 -0700
Subject: scsi: qla2xxx: Make qla2x00_abort_srb() again decrease the sp
reference count
Patch-mainline: v5.4-rc1
Git-commit: d2d2b5a5741d317bed1fa38211f1f3b142d8cf7a
References: jsc#SLE-9714 jsc#SLE-10327 jsc#SLE-10334 bnc#1151927 5.3.17
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>
Acked-by: Daniel Wagner <dwagner@suse.de>
---
drivers/scsi/qla2xxx/qla_os.c | 2 ++
1 file changed, 2 insertions(+)
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -1755,6 +1755,8 @@ static void qla2x00_abort_srb(struct qla
spin_lock_irqsave(qp->qp_lock_ptr, *flags);
sp->comp = NULL;
}
+
+ atomic_dec(&sp->ref_count);
}
static void