From: Bart Van Assche Date: Fri, 9 Aug 2019 03:01:22 +0000 (-0700) Subject: scsi: qla2xxx: Make qla2x00_abort_srb() again decrease the sp reference count X-Git-Tag: v5.4-rc1~89^2~187 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d2d2b5a5741d317bed1fa38211f1f3b142d8cf7a;p=thirdparty%2Fkernel%2Flinux.git scsi: qla2xxx: Make qla2x00_abort_srb() again decrease the sp reference count Since qla2x00_abort_srb() starts with increasing the reference count of @sp, decrease that same reference count before returning. Cc: Himanshu Madhani Fixes: 219d27d7147e ("scsi: qla2xxx: Fix race conditions in the code for aborting SCSI commands") # v5.2. Signed-off-by: Bart Van Assche Tested-by: Himanshu Madhani Reviewed-by: Himanshu Madhani Signed-off-by: Martin K. Petersen --- diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 17a3f91ba5a31..b667f13b62df0 100644 --- 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_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