slot->status_buffer = dma_pool_alloc(hisi_hba->status_buffer_pool,
                                             GFP_ATOMIC,
                                             &slot->status_buffer_dma);
-       if (!slot->status_buffer)
+       if (!slot->status_buffer) {
+               rc = -ENOMEM;
                goto err_out_slot_buf;
+       }
        memset(slot->status_buffer, 0, HISI_SAS_STATUS_BUF_SZ);
 
        slot->command_table = dma_pool_alloc(hisi_hba->command_table_pool,
                                             GFP_ATOMIC,
                                             &slot->command_table_dma);
-       if (!slot->command_table)
+       if (!slot->command_table) {
+               rc = -ENOMEM;
                goto err_out_status_buf;
+       }
        memset(slot->command_table, 0, HISI_SAS_COMMAND_TABLE_SZ);
        memset(slot->cmd_hdr, 0, sizeof(struct hisi_sas_cmd_hdr));
 
        sas_dev->running_req++;
        ++(*pass);
 
-       return rc;
+       return 0;
 
 err_out_sge:
        dma_pool_free(hisi_hba->sge_page_pool, slot->sge_page,