drm/amdgpu/ucode: Remove firmware load type check in amdgpu_ucode_free_bo
authorAlice Wong <shiwei.wong@amd.com>
Mon, 2 May 2022 15:40:18 +0000 (11:40 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jun 2022 08:22:35 +0000 (10:22 +0200)
commitb305469ed00420e53c66064b554531d6fbd98d5b
tree4cd74f5dca30107313878fd47946d41e81dc36d6
parenta2c87348acebd9bacedfe20cf82341928751ff91
drm/amdgpu/ucode: Remove firmware load type check in amdgpu_ucode_free_bo

[ Upstream commit ab0cd4a9ae5b4679b714d8dbfedc0901fecdce9f ]

When psp_hw_init failed, it will set the load_type to AMDGPU_FW_LOAD_DIRECT.
During amdgpu_device_ip_fini, amdgpu_ucode_free_bo checks that load_type is
AMDGPU_FW_LOAD_DIRECT and skips deallocating fw_buf causing memory leak.
Remove load_type check in amdgpu_ucode_free_bo.

Signed-off-by: Alice Wong <shiwei.wong@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@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_ucode.c