drm/amdgpu: Improve error handling for HMM
authorFelix Kuehling <Felix.Kuehling@amd.com>
Tue, 7 May 2019 21:46:14 +0000 (17:46 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 24 May 2019 17:21:02 +0000 (12:21 -0500)
commit1986a3b022bee7ad34d0c539b32a81575bf3c9a3
tree21a48329d9d9ace6691d8530d43e2fd1a1d83e38
parentb9c5eb5b801a76df47e12a5754dcc1d3c4b34625
drm/amdgpu: Improve error handling for HMM

Use unsigned long for number of pages.

Check that pfns are valid after hmm_vma_fault. If they are not,
return an error instead of continuing with invalid page pointers and
PTEs.

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Philip Yang <Philip.Yang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c