提交 0f6f9dd4 编写于 作者: D Daniel Gomez 提交者: Alex Deucher

drm/amdgpu/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>
上级 5d3a2d95
......@@ -1087,13 +1087,13 @@ static void amdgpu_ttm_backend_unbind(struct ttm_device *bdev,
struct amdgpu_ttm_tt *gtt = (void *)ttm;
int r;
if (!gtt->bound)
return;
/* if the pages have userptr pinning then clear that first */
if (gtt->userptr)
amdgpu_ttm_tt_unpin_userptr(bdev, ttm);
if (!gtt->bound)
return;
if (gtt->offset == AMDGPU_BO_INVALID_OFFSET)
return;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册