drm/amdkfd: add missing return value check for range

amdgpu_hmm_range_alloc could fails in case of low
memory condition and hence we should have a check
for the return value.

Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
Reviewed-by: Shirish S <shirish.s@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Sunil Khatri
2025-10-24 10:14:56 +05:30
committed by Alex Deucher
parent 97010d7732
commit 7bb02a34c2

View File

@@ -1738,6 +1738,11 @@ static int svm_range_validate_and_map(struct mm_struct *mm,
WRITE_ONCE(p->svms.faulting_task, current);
range = amdgpu_hmm_range_alloc(NULL);
if (unlikely(!range)) {
r = -ENOMEM;
goto free_ctx;
}
r = amdgpu_hmm_range_get_pages(&prange->notifier, addr, npages,
readonly, owner,
range);