Commit d87e72fb authored by Xiaofei Tan's avatar Xiaofei Tan Committed by Martin K. Petersen

scsi: hisi_sas: Fix return value when get_free_slot() failed

It is an step of executing task to get free slot. If the step fails, we
will cleanup LLDD resources and should return failure to upper layer or
internal caller to abort task execution of this time.

But in the current code, the caller of get_free_slot() doesn't return
failure when get_free_slot() failed. This patch is to fix it.
Signed-off-by: default avatarXiaofei Tan <tanxiaofei@huawei.com>
Signed-off-by: default avatarJohn Garry <john.garry@huawei.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 31709548
...@@ -443,6 +443,7 @@ static int hisi_sas_task_prep(struct sas_task *task, ...@@ -443,6 +443,7 @@ static int hisi_sas_task_prep(struct sas_task *task,
wr_q_index = hisi_hba->hw->get_free_slot(hisi_hba, dq); wr_q_index = hisi_hba->hw->get_free_slot(hisi_hba, dq);
if (wr_q_index < 0) { if (wr_q_index < 0) {
spin_unlock_irqrestore(&dq->lock, flags_dq); spin_unlock_irqrestore(&dq->lock, flags_dq);
rc = -EAGAIN;
goto err_out_buf; goto err_out_buf;
} }
...@@ -1708,6 +1709,7 @@ hisi_sas_internal_abort_task_exec(struct hisi_hba *hisi_hba, int device_id, ...@@ -1708,6 +1709,7 @@ hisi_sas_internal_abort_task_exec(struct hisi_hba *hisi_hba, int device_id,
wr_q_index = hisi_hba->hw->get_free_slot(hisi_hba, dq); wr_q_index = hisi_hba->hw->get_free_slot(hisi_hba, dq);
if (wr_q_index < 0) { if (wr_q_index < 0) {
spin_unlock_irqrestore(&dq->lock, flags_dq); spin_unlock_irqrestore(&dq->lock, flags_dq);
rc = -EAGAIN;
goto err_out_buf; goto err_out_buf;
} }
list_add_tail(&slot->delivery, &dq->list); list_add_tail(&slot->delivery, &dq->list);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment