mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-23 11:04:44 +08:00
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>
This commit is contained in:
parent
a3405d0c71
commit
e5197a4c3d
@ -411,6 +411,7 @@ static int amdgpu_vm_alloc_levels(struct amdgpu_device *adev,
|
||||
|
||||
r = amdgpu_vm_clear_bo(adev, vm, pt, level, ats);
|
||||
if (r) {
|
||||
amdgpu_bo_unref(&pt->shadow);
|
||||
amdgpu_bo_unref(&pt);
|
||||
return r;
|
||||
}
|
||||
@ -418,6 +419,7 @@ static int amdgpu_vm_alloc_levels(struct amdgpu_device *adev,
|
||||
if (vm->use_cpu_for_update) {
|
||||
r = amdgpu_bo_kmap(pt, NULL);
|
||||
if (r) {
|
||||
amdgpu_bo_unref(&pt->shadow);
|
||||
amdgpu_bo_unref(&pt);
|
||||
return r;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user