diff options
author | Christian König <christian.koenig@amd.com> | 2018-02-02 15:00:44 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-02-19 14:19:20 -0500 |
commit | e5197a4c3dbff322efe1f70e23453318554d1598 (patch) | |
tree | 417569b0c75023b5555968f3d4c04d3625b3be61 /drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | |
parent | a3405d0c712df4b9fb34e6b1f6771b18f462bdd3 (diff) |
drm/amdgpu: release the VM shadow in the error path as well
Without it we run into a memory leak.
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index 61cf93867b8e..b43098f02a40 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | |||
@@ -411,6 +411,7 @@ static int amdgpu_vm_alloc_levels(struct amdgpu_device *adev, | |||
411 | 411 | ||
412 | r = amdgpu_vm_clear_bo(adev, vm, pt, level, ats); | 412 | r = amdgpu_vm_clear_bo(adev, vm, pt, level, ats); |
413 | if (r) { | 413 | if (r) { |
414 | amdgpu_bo_unref(&pt->shadow); | ||
414 | amdgpu_bo_unref(&pt); | 415 | amdgpu_bo_unref(&pt); |
415 | return r; | 416 | return r; |
416 | } | 417 | } |
@@ -418,6 +419,7 @@ static int amdgpu_vm_alloc_levels(struct amdgpu_device *adev, | |||
418 | if (vm->use_cpu_for_update) { | 419 | if (vm->use_cpu_for_update) { |
419 | r = amdgpu_bo_kmap(pt, NULL); | 420 | r = amdgpu_bo_kmap(pt, NULL); |
420 | if (r) { | 421 | if (r) { |
422 | amdgpu_bo_unref(&pt->shadow); | ||
421 | amdgpu_bo_unref(&pt); | 423 | amdgpu_bo_unref(&pt); |
422 | return r; | 424 | return r; |
423 | } | 425 | } |