]> 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>
Thu, 17 Oct 2019 21:12:34 +0000 (17:12 -0400)
commited584c282c39f9fa783d2c0de12343ec8d053b3d
treea90d666dd853c9507c87c04c9adc1feaf5453522
parent12a92de3cc8774bb6978ee962dcf2d54857a6641
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>
Cc: stable@vger.kernel.org # 5.3
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c