drm/amdgpu: fix leak when we don't use the vm_fence
Subsystems (2)
Alex Deucher
maintainerPATCH 1/1 drm/amdgpu: fix leak when we don't use the vm_fence
If we don't end up using the vm fence, we never initialize it so it never gets freed. Free it in that case.
Fixes db36632ea51e ("drm/amdgpu: clean up and unify hw fence handling")
Signed-off-by Alex Deucher <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +3 -0
@@ -845,6 +845,9 @@ int amdgpu_vm_flush(struct amdgpu_ring *ring, struct amdgpu_job *job,if (r)return r; fence = &job->hw_vm_fence->base; + }else { +/* free the vm fence if we are not using it */ +kfree (job->hw_vm_fence); }if (vm_flush_needed) {
Signature · 1 line
2.51.0
Quoted 6 lines · Alex Deucher
If we don't end up using the vm fence, we never initialize it so it never gets freed. Free it in that case.
Fixes db36632ea51e ("drm/amdgpu: clean up and unify hw fence handling")Signed-off-by Alex Deucher <[email protected]>
I have a better fix. Ignore this.
Alex
Quoted 21 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 3 +++ 1 file changed, 3 insertions(+)drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +3
-1@@ -845,6 +845,9 @@ int amdgpu_vm_flush(struct amdgpu_ring *ring, struct amdgpu_job *job,if (r)return r; fence = &job->hw_vm_fence->base; + }else { +/* free the vm fence if we are not using it */ +kfree (job->hw_vm_fence); }if (vm_flush_needed) { --2.51.0