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.
Unified · Split
| @@ -787,8 +787,7 @@ int amdgpu_ucode_create_bo(struct amdgpu_device *adev) · 786 unmodified lines | |||
| 787 | 787 | ||
| 788 | void amdgpu_ucode_free_bo(struct amdgpu_device *adev) | 788 | void amdgpu_ucode_free_bo(struct amdgpu_device *adev) |
| 789 | { | 789 | { |
| 790 | if (adev->firmware.load_type != AMDGPU_FW_LOAD_DIRECT) | 790 | amdgpu_bo_free_kernel(&adev->firmware.fw_buf, |
| 791 | amdgpu_bo_free_kernel(&adev->firmware.fw_buf, | ||
| 792 | &adev->firmware.fw_buf_mc, | 791 | &adev->firmware.fw_buf_mc, |
| 793 | &adev->firmware.fw_buf_ptr); | 792 | &adev->firmware.fw_buf_ptr); |
| 794 | } | 793 | } |