diff mbox series

[-next] scsi: hisi_sas: Fix missing unlock on error in hisi_sas_phy_read32()

Message ID 1539835114-60506-1-git-send-email-weiyongjun1@huawei.com (mailing list archive)
State Superseded
Headers show
Series [-next] scsi: hisi_sas: Fix missing unlock on error in hisi_sas_phy_read32() | expand

Commit Message

Wei Yongjun Oct. 18, 2018, 3:58 a.m. UTC
Add the missing unlock before return from function hisi_sas_phy_read32()
in the error handling case.

Fixes: 784b46b7cba0 ("scsi: hisi_sas: Use block layer tag instead for IPTT")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

John Garry Oct. 18, 2018, 8:12 a.m. UTC | #1
On 18/10/2018 04:58, Wei Yongjun wrote:
> Add the missing unlock before return from function hisi_sas_phy_read32()
> in the error handling case.
>
> Fixes: 784b46b7cba0 ("scsi: hisi_sas: Use block layer tag instead for IPTT")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
>  drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
> index 70d6b28..cc36b64 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 @@ static u32 hisi_sas_phy_read32(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.
>  		  */
>
>

This has already been fixed

thanks
diff mbox series

Patch

diff --git a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
index 70d6b28..cc36b64 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 @@  static u32 hisi_sas_phy_read32(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.
 		  */