mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 06:25:52 +02:00
drm/amdgpu/ttm: Fix memory leak userptr pages
[ Upstream commit 0f6f9dd490 ]
If userptr pages have been pinned but not bounded,
they remain uncleared.
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Daniel Gomez <daniel@qtec.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
6e4ae9b0eb
commit
14637a8dfe
|
|
@ -1254,13 +1254,13 @@ static void amdgpu_ttm_backend_unbind(struct ttm_bo_device *bdev,
|
||||||
struct amdgpu_ttm_tt *gtt = (void *)ttm;
|
struct amdgpu_ttm_tt *gtt = (void *)ttm;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
if (!gtt->bound)
|
|
||||||
return;
|
|
||||||
|
|
||||||
/* if the pages have userptr pinning then clear that first */
|
/* if the pages have userptr pinning then clear that first */
|
||||||
if (gtt->userptr)
|
if (gtt->userptr)
|
||||||
amdgpu_ttm_tt_unpin_userptr(bdev, ttm);
|
amdgpu_ttm_tt_unpin_userptr(bdev, ttm);
|
||||||
|
|
||||||
|
if (!gtt->bound)
|
||||||
|
return;
|
||||||
|
|
||||||
if (gtt->offset == AMDGPU_BO_INVALID_OFFSET)
|
if (gtt->offset == AMDGPU_BO_INVALID_OFFSET)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user