lkml.org 
[lkml]   [2021]   [Jun]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] drm/amdgpu: Use vma_lookup() in amdgpu_ttm_tt_get_user_pages()
From
Date
Am 03.06.21 um 18:09 schrieb Liam Howlett:
> Use vma_lookup() to find the VMA at a specific address. As vma_lookup()
> will return NULL if the address is not within any VMA, the start address
> no longer needs to be validated.
>
> Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>

Reviewed-by: Christian König <christian.koenig@amd.com>

> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> index 7cb7ffdd1900..dfb5ca3f8da8 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> @@ -680,9 +680,9 @@ int amdgpu_ttm_tt_get_user_pages(struct amdgpu_bo *bo, struct page **pages)
> return -ESRCH;
>
> mmap_read_lock(mm);
> - vma = find_vma(mm, start);
> + vma = vma_lookup(mm, start);
> mmap_read_unlock(mm);
> - if (unlikely(!vma || start < vma->vm_start)) {
> + if (unlikely(!vma)) {
> r = -EFAULT;
> goto out_putmm;
> }

\
 
 \ /
  Last update: 2021-06-04 13:12    [W:0.064 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site