diff options
| author | Daniel Gomez <[email protected]> | 2021-03-17 16:08:37 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2021-04-09 20:37:34 +0000 |
| commit | 0f6f9dd490d524930081a6ef1d60171ce39220b9 (patch) | |
| tree | e8d81b7d24436a8b10a41b73b57e9a7577def28b /drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | |
| parent | drm/amdgpu: skip kfd suspend/resume for S0ix (diff) | |
| download | kernel-0f6f9dd490d524930081a6ef1d60171ce39220b9.tar.gz kernel-0f6f9dd490d524930081a6ef1d60171ce39220b9.zip | |
drm/amdgpu/ttm: Fix memory leak userptr pages
If userptr pages have been pinned but not bounded,
they remain uncleared.
Reviewed-by: Christian König <[email protected]>
Signed-off-by: Daniel Gomez <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c index 1c6131489a85..8f981034d704 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c @@ -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; |
