[PATCH] drm/amd: Fix an error handling mistake in psp_sw_init()
Limonciello, Mario
Mario.Limonciello at amd.com
Tue Jul 18 20:04:07 UTC 2023
[Public]
> -----Original Message-----
> From: Limonciello, Mario <Mario.Limonciello at amd.com>
> Sent: Thursday, July 13, 2023 00:15
> To: amd-gfx at lists.freedesktop.org
> Cc: Limonciello, Mario <Mario.Limonciello at amd.com>
> Subject: [PATCH] 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: b95b5391684b ("drm/amdgpu/psp: move PSP memory alloc from
> hw_init to sw_init")
> Signed-off-by: Mario Limonciello <mario.limonciello at amd.com>
Ping on this one.
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> index 1b4d5f04d968..6ffc1a640d2d 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> @@ -491,11 +491,11 @@ static int psp_sw_init(void *handle)
> return 0;
>
> failed2:
> - amdgpu_bo_free_kernel(&psp->fw_pri_bo,
> - &psp->fw_pri_mc_addr, &psp->fw_pri_buf);
> -failed1:
> amdgpu_bo_free_kernel(&psp->fence_buf_bo,
> &psp->fence_buf_mc_addr, &psp->fence_buf);
> +failed1:
> + amdgpu_bo_free_kernel(&psp->fw_pri_bo,
> + &psp->fw_pri_mc_addr, &psp->fw_pri_buf);
> return ret;
> }
>
> --
> 2.34.1
More information about the amd-gfx
mailing list