drm/amdgpu/psp: deallocate memory when psp_load_fw failed
authorAlice Wong <shiwei.wong@amd.com>
Thu, 28 Apr 2022 01:03:54 +0000 (21:03 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 4 May 2022 13:55:07 +0000 (09:55 -0400)
commite2c34219d16e8c3710278b4e23ebd5bc1ec7b804
treefb52908aebcf0d22250faef801727731f501a202
parentda40bf8f9376370b5bc2fda07aadaaddc308b1eb
drm/amdgpu/psp: deallocate memory when psp_load_fw failed

psp_load_fw failure would cause memory leak for psp tmr and psp ring
because psp_hw_init is not called as psp block is not fully initialized.
Clean up psp tmr and psp ring when psp_load_fw fail by calling
psp_free_shared_bufs and psp_ring_destroy.

Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alice Wong <shiwei.wong@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c