]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit606cca59050fc5ffc6474a79b583c71646ffff35
tree2cd29f120d6ab508157ac876551e9f917b24e995
parent4e4e67edbded57af8b157df718ab53b4bd9799ec
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