History

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.

Alice Wong committed 4 years ago

Commit ab0cd4a1 parent 6d5276c1 file · +1 −2Browse files

Unified · Split

drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c+1−2
@@ -787,8 +787,7 @@ int amdgpu_ucode_create_bo(struct amdgpu_device *adev) · 786 unmodified lines
787 787
788void amdgpu_ucode_free_bo(struct amdgpu_device *adev)788void 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}