Commit ab0cd4a9 authored by Alice Wong's avatar Alice Wong Committed by Alex Deucher

drm/amdgpu/ucode: Remove firmware load type check in amdgpu_ucode_free_bo

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: default avatarAlice Wong <shiwei.wong@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 6d5276cd
...@@ -787,8 +787,7 @@ int amdgpu_ucode_create_bo(struct amdgpu_device *adev) ...@@ -787,8 +787,7 @@ int amdgpu_ucode_create_bo(struct amdgpu_device *adev)
void amdgpu_ucode_free_bo(struct amdgpu_device *adev) void amdgpu_ucode_free_bo(struct amdgpu_device *adev)
{ {
if (adev->firmware.load_type != AMDGPU_FW_LOAD_DIRECT) amdgpu_bo_free_kernel(&adev->firmware.fw_buf,
amdgpu_bo_free_kernel(&adev->firmware.fw_buf,
&adev->firmware.fw_buf_mc, &adev->firmware.fw_buf_mc,
&adev->firmware.fw_buf_ptr); &adev->firmware.fw_buf_ptr);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment