Commit 9c9d18e7 authored by Dan Carpenter's avatar Dan Carpenter Committed by Martin K. Petersen

hisi_sas: fix error codes in hisi_sas_task_prep()

There were a couple cases where the error codes weren't set and also I
changed the success return to "return 0;" which is the same as
"return rc;" but more explicit.

Fixes: 42e7a693 ('hisi_sas: Add ssp command functio')
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Tested-by: default avatarJohn Garry <john.garry@huawei.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 9a2fcad8
...@@ -208,15 +208,19 @@ static int hisi_sas_task_prep(struct sas_task *task, struct hisi_hba *hisi_hba, ...@@ -208,15 +208,19 @@ static int hisi_sas_task_prep(struct sas_task *task, struct hisi_hba *hisi_hba,
slot->status_buffer = dma_pool_alloc(hisi_hba->status_buffer_pool, slot->status_buffer = dma_pool_alloc(hisi_hba->status_buffer_pool,
GFP_ATOMIC, GFP_ATOMIC,
&slot->status_buffer_dma); &slot->status_buffer_dma);
if (!slot->status_buffer) if (!slot->status_buffer) {
rc = -ENOMEM;
goto err_out_slot_buf; goto err_out_slot_buf;
}
memset(slot->status_buffer, 0, HISI_SAS_STATUS_BUF_SZ); memset(slot->status_buffer, 0, HISI_SAS_STATUS_BUF_SZ);
slot->command_table = dma_pool_alloc(hisi_hba->command_table_pool, slot->command_table = dma_pool_alloc(hisi_hba->command_table_pool,
GFP_ATOMIC, GFP_ATOMIC,
&slot->command_table_dma); &slot->command_table_dma);
if (!slot->command_table) if (!slot->command_table) {
rc = -ENOMEM;
goto err_out_status_buf; goto err_out_status_buf;
}
memset(slot->command_table, 0, HISI_SAS_COMMAND_TABLE_SZ); memset(slot->command_table, 0, HISI_SAS_COMMAND_TABLE_SZ);
memset(slot->cmd_hdr, 0, sizeof(struct hisi_sas_cmd_hdr)); memset(slot->cmd_hdr, 0, sizeof(struct hisi_sas_cmd_hdr));
...@@ -254,7 +258,7 @@ static int hisi_sas_task_prep(struct sas_task *task, struct hisi_hba *hisi_hba, ...@@ -254,7 +258,7 @@ static int hisi_sas_task_prep(struct sas_task *task, struct hisi_hba *hisi_hba,
sas_dev->running_req++; sas_dev->running_req++;
++(*pass); ++(*pass);
return rc; return 0;
err_out_sge: err_out_sge:
dma_pool_free(hisi_hba->sge_page_pool, slot->sge_page, dma_pool_free(hisi_hba->sge_page_pool, slot->sge_page,
......
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