提交 380ecf3c 编写于 作者: A Alice Wong 提交者: Zheng Zengkai

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

stable inclusion
from stable-v5.10.121
commit 3ee67465f7115cea05e8ef59840a3529b5911fa4
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5L6CQ

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=3ee67465f7115cea05e8ef59840a3529b5911fa4

--------------------------------

[ Upstream commit ab0cd4a9 ]

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: NAlice Wong <shiwei.wong@amd.com>
Reviewed-by: NAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
上级 f035dbbc
...@@ -625,8 +625,7 @@ int amdgpu_ucode_create_bo(struct amdgpu_device *adev) ...@@ -625,8 +625,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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册