mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
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:
committed by
Alex Deucher
parent
97010d7732
commit
7bb02a34c2
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user