summaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorXiaofei Tan2018-05-21 12:09:24 +0200
committerMartin K. Petersen2018-05-29 04:40:32 +0200
commitd87e72fb4fda6c48909e870811ae5252d0520f99 (patch)
tree3375c927c0d55afd31aa2f492ec9adab1ed2f422 /drivers/scsi
parentscsi: hisi_sas: Terminate STP reject quickly for v2 hw (diff)
downloadkernel-qcow2-linux-d87e72fb4fda6c48909e870811ae5252d0520f99.tar.gz
kernel-qcow2-linux-d87e72fb4fda6c48909e870811ae5252d0520f99.tar.xz
kernel-qcow2-linux-d87e72fb4fda6c48909e870811ae5252d0520f99.zip
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: Xiaofei Tan <tanxiaofei@huawei.com> Signed-off-by: John Garry <john.garry@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/hisi_sas/hisi_sas_main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c
index cd55849bcd07..3028024cb437 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_main.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_main.c
@@ -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);
if (wr_q_index < 0) {
spin_unlock_irqrestore(&dq->lock, flags_dq);
+ rc = -EAGAIN;
goto err_out_buf;
}
@@ -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);
if (wr_q_index < 0) {
spin_unlock_irqrestore(&dq->lock, flags_dq);
+ rc = -EAGAIN;
goto err_out_buf;
}
list_add_tail(&slot->delivery, &dq->list);