aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2315-drm-amdgpu-fix-memory-leak-in-preemption-unit-test.patch
blob: 1caa94ab3a0e8af37cec9f27e2142a5bb6fde283 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
From 7cf0a85405076ad3fe61ff970e8037dc9c11d04f Mon Sep 17 00:00:00 2001
From: Jack Xiao <Jack.Xiao@amd.com>
Date: Sat, 6 Apr 2019 10:16:52 +0800
Subject: [PATCH 2315/2940] drm/amdgpu: fix memory leak in preemption unit test

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

Signed-off-by: Jack Xiao <Jack.Xiao@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 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);
 }
-- 
2.17.1