drm/amdgpu: fix a potential memory leak in amdgpu_device_fini_sw()
authorLang Yu <lang.yu@amd.com>
Thu, 21 Oct 2021 06:36:36 +0000 (14:36 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Nov 2021 18:16:43 +0000 (19:16 +0100)
commit76eb974438109209b02758d7a3ac726c9c653439
treefe7ea3a79340465df33fe91357843c101fd55045
parentd834f80e51d7723c993336330ed106d602f1d22d
drm/amdgpu: fix a potential memory leak in amdgpu_device_fini_sw()

[ Upstream commit a5c5d8d50ecf5874be90a76e1557279ff8a30c9e ]

amdgpu_fence_driver_sw_fini() should be executed before
amdgpu_device_ip_fini(), otherwise fence driver resource
won't be properly freed as adev->rings have been tore down.

Fixes: 72c8c97b1522 ("drm/amdgpu: Split amdgpu_device_fini into early and late")
Signed-off-by: Lang Yu <lang.yu@amd.com>
Reviewed-by: Andrey Grodzovsky <andrey.grodzovsky@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_device.c