drm/amdgpu: fix Null pointer dereference error in amdgpu_device_recover_vram
authorHoratio Zhang <Hongkun.Zhang@amd.com>
Mon, 29 May 2023 18:23:37 +0000 (14:23 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Jun 2023 09:15:22 +0000 (11:15 +0200)
commitc5a17f3247bd7f6c2e22678dbfcd73832f487e3f
tree74cbd1f0c91bbd240f8c616d4edd20ed4aff9b5c
parentdbc880567adf48661ca9cb4506073e846bf64203
drm/amdgpu: fix Null pointer dereference error in amdgpu_device_recover_vram

[ Upstream commit 2a1eb1a343208ce7d6839b73d62aece343e693ff ]

Use the function of amdgpu_bo_vm_destroy to handle the resource release
of shadow bo. During the amdgpu_mes_self_test, shadow bo released, but
vmbo->shadow_list was not, which caused a null pointer reference error
in amdgpu_device_recover_vram when GPU reset.

Fixes: 6c032c37ac3e ("drm/amdgpu: Fix vram recover doesn't work after whole GPU reset (v2)")
Signed-off-by: xinhui pan <xinhui.pan@amd.com>
Signed-off-by: Horatio Zhang <Hongkun.Zhang@amd.com>
Acked-by: Feifei Xu <Feifei.Xu@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_object.c
drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c