drm/amdkfd: fix double free mem structure
authorPhilip Yang <Philip.Yang@amd.com>
Fri, 26 Nov 2021 23:43:09 +0000 (18:43 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Dec 2021 09:30:16 +0000 (10:30 +0100)
commitd9e63f180fc8143ae77447b1d5a354b0f13e6b0e
tree0f904aabbaa3fc9bfd0629c6c410de2867afd2ed
parent00a3f7fb7ae3ebccaa08d2309ceb35dfb1a4bc90
drm/amdkfd: fix double free mem structure

[ Upstream commit 494f2e42ce4a9ddffb5d8c5b2db816425ef90397 ]

drm_gem_object_put calls release_notify callback to free the mem
structure and unreserve_mem_limit, move it down after the last access
of mem and make it conditional call.

Signed-off-by: Philip Yang <Philip.Yang@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c