Commit 5aeaa43e authored by Daniel Gomez's avatar Daniel Gomez Committed by Alex Deucher

drm/radeon/ttm: Fix memory leak userptr pages

If userptr pages have been pinned but not bounded,
they remain uncleared.
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarDaniel Gomez <daniel@qtec.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 0f6f9dd4
......@@ -481,13 +481,14 @@ static void radeon_ttm_backend_unbind(struct ttm_device *bdev, struct ttm_tt *tt
struct radeon_ttm_tt *gtt = (void *)ttm;
struct radeon_device *rdev = radeon_get_rdev(bdev);
if (gtt->userptr)
radeon_ttm_tt_unpin_userptr(bdev, ttm);
if (!gtt->bound)
return;
radeon_gart_unbind(rdev, gtt->offset, ttm->num_pages);
if (gtt->userptr)
radeon_ttm_tt_unpin_userptr(bdev, ttm);
gtt->bound = false;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment