Re: [PATCH 201/459] drm/amdgpu: fix memory leak in preemption unit test

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Can probably be squashed into the original adding of the unit test.

Christian.

Am 17.06.19 um 21:29 schrieb Alex Deucher:
From: Jack Xiao <Jack.Xiao@xxxxxxx>

It forgot to put job fence, caused fence memory leak.

Signed-off-by: Jack Xiao <Jack.Xiao@xxxxxxx>
Reviewed-by: Alex Deucher <alexander.deucher@xxxxxxx>
Signed-off-by: Alex Deucher <alexander.deucher@xxxxxxx>
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
index 28614dd05f88..4997efa09ce7 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
@@ -968,10 +968,12 @@ static void amdgpu_ib_preempt_signal_fences(struct dma_fence **fences,
  static void amdgpu_ib_preempt_job_recovery(struct drm_gpu_scheduler *sched)
  {
  	struct drm_sched_job *s_job;
+	struct dma_fence *fence;
spin_lock(&sched->job_list_lock);
  	list_for_each_entry(s_job, &sched->ring_mirror_list, node) {
-		sched->ops->run_job(s_job);
+		fence = sched->ops->run_job(s_job);
+		dma_fence_put(fence);
  	}
  	spin_unlock(&sched->job_list_lock);
  }

_______________________________________________
amd-gfx mailing list
amd-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/amd-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux