mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 14:42:37 +02:00
drm/radeon/ttm: Fix memory leak userptr pages
[ Upstream commit 5aeaa43e0e ]
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
14637a8dfe
commit
bcefa89b3e
|
|
@ -566,13 +566,14 @@ static void radeon_ttm_backend_unbind(struct ttm_bo_device *bdev, struct ttm_tt
|
||||||
struct radeon_ttm_tt *gtt = (void *)ttm;
|
struct radeon_ttm_tt *gtt = (void *)ttm;
|
||||||
struct radeon_device *rdev = radeon_get_rdev(bdev);
|
struct radeon_device *rdev = radeon_get_rdev(bdev);
|
||||||
|
|
||||||
|
if (gtt->userptr)
|
||||||
|
radeon_ttm_tt_unpin_userptr(bdev, ttm);
|
||||||
|
|
||||||
if (!gtt->bound)
|
if (!gtt->bound)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
radeon_gart_unbind(rdev, gtt->offset, ttm->num_pages);
|
radeon_gart_unbind(rdev, gtt->offset, ttm->num_pages);
|
||||||
|
|
||||||
if (gtt->userptr)
|
|
||||||
radeon_ttm_tt_unpin_userptr(bdev, ttm);
|
|
||||||
gtt->bound = false;
|
gtt->bound = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user