From: John Garry Date: Tue, 16 Oct 2018 15:00:36 +0000 (+0800) Subject: scsi: hisi_sas: Fix spin lock management in slot_index_alloc_quirk_v2_hw() X-Git-Tag: archive/raspbian/5.2.17-1+rpi1^2^2^2~30 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=0db3d2910c3c6cd4caa4c4e5ebf9eba867da6490;p=linux.git scsi: hisi_sas: Fix spin lock management in slot_index_alloc_quirk_v2_hw() Currently a spin_unlock_irqrestore() call is missing on the error path, so add it. Reported-by: Julia Lawall Signed-off-by: John Garry Signed-off-by: Martin K. Petersen Gbp-Pq: Topic bugfix/arm64/huawei-taishan Gbp-Pq: Name 0008-scsi-hisi_sas-Fix-spin-lock-management-in-slot_index.patch --- diff --git a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c index 58a564c75a3..77a85ead483 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c @@ -806,8 +806,10 @@ slot_index_alloc_quirk_v2_hw(struct hisi_hba *hisi_hba, while (1) { start = find_next_zero_bit(bitmap, hisi_hba->slot_index_count, start); - if (start >= end) + if (start >= end) { + spin_unlock_irqrestore(&hisi_hba->lock, flags); return -SAS_QUEUE_FULL; + } /* * SAS IPTT bit0 should be 1, and SATA IPTT bit0 should be 0. */