OSDN Git Service

drm/amdgpu: user pages array memory leak fix
authorPhilip Yang <Philip.Yang@amd.com>
Thu, 3 Oct 2019 18:18:25 +0000 (14:18 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 15 Oct 2019 19:51:01 +0000 (15:51 -0400)
commit06f7f57e87d09900a7c3109a357b73521ab40771
tree2cd29f120d6ab508157ac876551e9f917b24e995
parent7bbdbe405965dc4998996bdea571a5b9a1dd3d16
drm/amdgpu: user pages array memory leak fix

user_pages array should always be freed after validation regardless if
user pages are changed after bo is created because with HMM change parse
bo always allocate user pages array to get user pages for userptr bo.

v2: remove unused local variable and amend commit

v3: add back get user pages in gem_userptr_ioctl, to detect application
bug where an userptr VMA is not ananymous memory and reject it.

Bugzilla: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1844962

Signed-off-by: Philip Yang <Philip.Yang@amd.com>
Tested-by: Joe Barnett <thejoe@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c