提交 5aeaa43e 编写于 作者: D Daniel Gomez 提交者: Alex Deucher

drm/radeon/ttm: Fix memory leak userptr pages

If userptr pages have been pinned but not bounded,
they remain uncleared.
Reviewed-by: NChristian König <christian.koenig@amd.com>
Signed-off-by: NDaniel Gomez <daniel@qtec.com>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册