Otherwise we're leaking memory.

Fixes: a35c520c1611 ("drm/amdgpu: clean up and unify hw fence handling")
Signed-off-by: Pierre-Eric Pelloux-Prayer <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
index 2fc3d9da0fe7..91f1232b7d41 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
@@ -246,6 +246,8 @@ int amdgpu_job_alloc_with_ib(struct amdgpu_device *adev,
        if (r) {
                if (entity)
                        drm_sched_job_cleanup(&(*job)->base);
+               kfree((*job)->hw_vm_fence);
+               kfree((*job)->hw_fence);
                kfree(*job);
                *job = NULL;
        }
-- 
2.43.0

Reply via email to