]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/amdgpu: fix a memory leak in fence cleanup when unloading
authorAlex Deucher <alexander.deucher@amd.com>
Mon, 15 Sep 2025 02:31:27 +0000 (22:31 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 19 Sep 2025 14:30:00 +0000 (16:30 +0200)
commit9c2e5bb8c1b29e82d736b60465f9b0d8a3a64dab
tree8d9f5bd8b49e1bfa171c6212265d53f019d51ac4
parent98244fc86ffc1ac2075647f8913537e21b40a51e
drm/amdgpu: fix a memory leak in fence cleanup when unloading

[ Upstream commit 7838fb5f119191403560eca2e23613380c0e425e ]

Commit b61badd20b44 ("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: b61badd20b44 ("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 a525fa37aac36c4591cc8b07ae8957862415fbd5)
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>
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c