drm/amd: Fix an error handling mistake in psp_sw_init()
Subsystems (2)
PATCH 1/1 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.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +3 -3
@@ -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; }
Signature · 1 line
2.34.1
[Public]
Quoted 7 lines
-----Original Message-----
From: Limonciello, Mario <[email protected]>
Sent: Thursday, July 13, 2023 00:15
To: [email protected]
Cc: Limonciello, Mario <[email protected]>
Subject: [PATCH] drm/amd: Fix an error handling mistake inpsp_sw_init()
Quoted 7 lines
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_inittosw_init")Signed-off-by Mario Limonciello <[email protected]>
Ping on this one.
Quoted 26 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +3
-4@@ -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
Lazar, Lijo
Reviewed-byQuoted 15 lines · Mario
[Public]
[Public]
Quoted 11 lines
-----Original Message-----
From: Limonciello, Mario <[email protected]>
Sent: Thursday, July 13, 2023 00:15
To: [email protected]
Cc: Limonciello, Mario <[email protected]>
Subject: [PATCH] drm/amd: Fix an error handling mistake inpsp_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.
Quoted 6 lines
Quoted 3 lines
Fixes b95b5391684b ("drm/amdgpu/psp: move PSP memory alloc from
hw_inittosw_init")Signed-off-by Mario Limonciello <[email protected]>Ping on this one.
Thanks,
Lijo
Quoted 27 lines
Quoted 26 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +3
-4@@ -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