Skip to content

Commit 5539bc8

Browse files
alexdeuchergregkh
authored andcommitted
drm/amdgpu: fix a memory leak in fence cleanup when unloading
commit 7838fb5 upstream. 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 215ea32 commit 5539bc8

1 file changed

Lines changed: 0 additions & 3 deletions

File tree

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -400,9 +400,6 @@ void amdgpu_ring_fini(struct amdgpu_ring *ring)
400400
dma_fence_put(ring->vmid_wait);
401401
ring->vmid_wait = NULL;
402402
ring->me = 0;
403-
404-
if (!ring->is_mes_queue)
405-
ring->adev->rings[ring->idx] = NULL;
406403
}
407404

408405
/**

0 commit comments

Comments
 (0)