Skip to content

Commit 9c2e5bb

Browse files
alexdeuchergregkh
authored andcommitted
drm/amdgpu: fix a memory leak in fence cleanup when unloading
[ Upstream commit 7838fb5 ] Commit b61badd ("drm/amdgpu: fix usage slab after free") reordered when amdgpu_fence_driver_sw_fini() was called after that patch, amdgpu_fence_driver_sw_fini() effectively became a no-op as the sched entities we never freed because the ring pointers were already set to NULL. Remove the NULL setting. Reported-by: Lin.Cao <lincao12@amd.com> Cc: Vitaly Prosyak <vitaly.prosyak@amd.com> Cc: Christian König <christian.koenig@amd.com> Fixes: b61badd ("drm/amdgpu: fix usage slab after free") Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit a525fa3) Cc: stable@vger.kernel.org [ Adapt to conditional check ] Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 98244fc commit 9c2e5bb

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,9 +368,6 @@ void amdgpu_ring_fini(struct amdgpu_ring *ring)
368368
dma_fence_put(ring->vmid_wait);
369369
ring->vmid_wait = NULL;
370370
ring->me = 0;
371-
372-
if (!ring->is_mes_queue)
373-
ring->adev->rings[ring->idx] = NULL;
374371
}
375372

376373
/**

0 commit comments

Comments
 (0)