aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/hisi_sas
diff options
context:
space:
mode:
authorJohn Garry <john.garry@huawei.com>2018-10-16 23:00:36 +0800
committerMartin K. Petersen <martin.petersen@oracle.com>2018-10-16 17:50:49 -0400
commitfe5fb42de36227c1c2dbb1e7403329ec8a915c20 (patch)
tree30ea9037a07d1a7f104ae610804f69337814aee8 /drivers/scsi/hisi_sas
parentscsi: sg: remove bad blk_end_request_all() call (diff)
downloadlinux-dev-fe5fb42de36227c1c2dbb1e7403329ec8a915c20.tar.xz
linux-dev-fe5fb42de36227c1c2dbb1e7403329ec8a915c20.zip
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 <julia.lawall@lip6.fr> Signed-off-by: John Garry <john.garry@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/hisi_sas')
-rw-r--r--drivers/scsi/hisi_sas/hisi_sas_v2_hw.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
index 70d6b28f390a..cc36b6473e98 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.
*/