Commit fb10da93 authored by Dafna Hirschfeld's avatar Dafna Hirschfeld Committed by Oded Gabbay

accel/habanalabs: check return value of add_va_block_locked

since the function might fail and we should propagate the failure.
Signed-off-by: default avatarDafna Hirschfeld <dhirschfeld@habana.ai>
Reviewed-by: default avatarOded Gabbay <ogabbay@kernel.org>
Signed-off-by: default avatarOded Gabbay <ogabbay@kernel.org>
Reviewed-by: default avatarStanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
parent 957b247b
...@@ -605,6 +605,7 @@ static u64 get_va_block(struct hl_device *hdev, ...@@ -605,6 +605,7 @@ static u64 get_va_block(struct hl_device *hdev,
bool is_align_pow_2 = is_power_of_2(va_range->page_size); bool is_align_pow_2 = is_power_of_2(va_range->page_size);
bool is_hint_dram_addr = hl_is_dram_va(hdev, hint_addr); bool is_hint_dram_addr = hl_is_dram_va(hdev, hint_addr);
bool force_hint = flags & HL_MEM_FORCE_HINT; bool force_hint = flags & HL_MEM_FORCE_HINT;
int rc;
if (is_align_pow_2) if (is_align_pow_2)
align_mask = ~((u64)va_block_align - 1); align_mask = ~((u64)va_block_align - 1);
...@@ -722,9 +723,13 @@ static u64 get_va_block(struct hl_device *hdev, ...@@ -722,9 +723,13 @@ static u64 get_va_block(struct hl_device *hdev,
kfree(new_va_block); kfree(new_va_block);
} }
if (add_prev) if (add_prev) {
add_va_block_locked(hdev, &va_range->list, prev_start, rc = add_va_block_locked(hdev, &va_range->list, prev_start, prev_end);
prev_end); if (rc) {
reserved_valid_start = 0;
goto out;
}
}
print_va_list_locked(hdev, &va_range->list); print_va_list_locked(hdev, &va_range->list);
out: out:
......
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