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)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 28 Oct 2021 18:26:12 +0000 (14:26 -0400)
commita5c5d8d50ecf5874be90a76e1557279ff8a30c9e
tree82942545bb1b8d8c488a102dc2d4a43df965ead6
parent68df0f195a689bbb0f92bfeadee6edd90c79c31f
drm/amdgpu: fix a potential memory leak in amdgpu_device_fini_sw()

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>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c