Skip to content

Commit c01aebe

Browse files
superm1alexdeucher
authored andcommitted
drm/amd: Fix an error handling mistake in psp_sw_init()
If the second call to amdgpu_bo_create_kernel() fails, the memory allocated from the first call should be cleared. If the third call fails, the memory from the second call should be cleared. Fixes: b95b539 ("drm/amdgpu/psp: move PSP memory alloc from hw_init to sw_init") Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Reviewed-by: Lijo Lazar <lijo.lazar@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 9beb223 commit c01aebe

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -498,11 +498,11 @@ static int psp_sw_init(void *handle)
498498
return 0;
499499

500500
failed2:
501-
amdgpu_bo_free_kernel(&psp->fw_pri_bo,
502-
&psp->fw_pri_mc_addr, &psp->fw_pri_buf);
503-
failed1:
504501
amdgpu_bo_free_kernel(&psp->fence_buf_bo,
505502
&psp->fence_buf_mc_addr, &psp->fence_buf);
503+
failed1:
504+
amdgpu_bo_free_kernel(&psp->fw_pri_bo,
505+
&psp->fw_pri_mc_addr, &psp->fw_pri_buf);
506506
return ret;
507507
}
508508

0 commit comments

Comments
 (0)