drm/amdkfd: amdkfd_free_gtt_mem clear the correct pointer

[ Upstream commit c86ad39140 ]

Pass pointer reference to amdgpu_bo_unref to clear the correct pointer,
otherwise amdgpu_bo_unref clear the local variable, the original pointer
not set to NULL, this could cause use-after-free bug.

Signed-off-by: Philip Yang <Philip.Yang@amd.com>
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Philip Yang 2024-07-14 11:11:05 -04:00 • committed by Greg Kroah-Hartman
commit 30ceb873cc
8 changed files with 16 additions and 16 deletions