diff options
author | Christian König <christian.koenig@amd.com> | 2023-01-05 11:27:16 +0100 |
---|---|---|
committer | Christian König <christian.koenig@amd.com> | 2023-01-05 20:34:58 +0100 |
commit | 41cc108b2451e0c65e8c9c9f6a3e103b62b60bb3 (patch) | |
tree | 7e5d13ed11f1e8397d5b7ed3bdfe7860955c1d55 /drivers | |
parent | ed21f6c3fe423b17211fa5a85cd028621a749a2a (diff) |
drm/amdgpu: fix missing dma_fence_put in error path
When the fence can't be added we need to drop the reference.
Suggested-by: Bert Karwatzki <spasswolf@web.de>
Signed-off-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230105111703.52695-2-christian.koenig@amd.com
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Luben Tuikov <luben.tuikov@amd.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c index bac7976975bd..dcd8c066bc1f 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c @@ -391,8 +391,10 @@ int amdgpu_sync_push_to_job(struct amdgpu_sync *sync, struct amdgpu_job *job) dma_fence_get(f); r = drm_sched_job_add_dependency(&job->base, f); - if (r) + if (r) { + dma_fence_put(f); return r; + } } return 0; } |