drm/amdgpu: prevent toc firmware memory leak
Subsystems (2)
PATCH 1/1 drm/amdgpu: prevent toc firmware memory leak
It's missed in psp fini.
Signed-off-by Guchun Chen <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +5 -2
@@ -496,11 +496,14 @@ static int psp_sw_fini(void *handle)release_firmware (psp->ta_fw); psp->ta_fw =NULL ; } -if (adev->psp.cap_fw) { +if (psp->cap_fw) {release_firmware (psp->cap_fw); psp->cap_fw =NULL ; } - +if (psp->toc_fw) { +release_firmware (psp->toc_fw); + psp->toc_fw =NULL ; + }if (adev->ip_versions[MP0_HWIP ][0 ] ==IP_VERSION (11 ,0 ,0 ) || adev->ip_versions[MP0_HWIP ][0 ] ==IP_VERSION (11 ,0 ,7 ))psp_sysfs_fini (adev);
Signature · 1 line
2.25.1
[Public]
Reviewed-by Alex Deucher <[email protected]>
________________________________
From: Chen, Guchun <[email protected]>
Sent: Friday, September 2, 2022 2:11 AM
To: [email protected] <[email protected]>; Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; Pan, Xinhui <[email protected]>
Cc: Chen, Guchun <[email protected]>
Subject: [PATCH] drm/amdgpu: prevent toc firmware memory leak
It's missed in psp fini.
Signed-off-by Guchun Chen <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +5 -2
@@ -496,11 +496,14 @@ static int psp_sw_fini(void *handle)release_firmware (psp->ta_fw); psp->ta_fw =NULL ; } -if (adev->psp.cap_fw) { +if (psp->cap_fw) {release_firmware (psp->cap_fw); psp->cap_fw =NULL ; } - +if (psp->toc_fw) { +release_firmware (psp->toc_fw); + psp->toc_fw =NULL ; + }if (adev->ip_versions[MP0_HWIP ][0 ] ==IP_VERSION (11 ,0 ,0 ) || adev->ip_versions[MP0_HWIP ][0 ] ==IP_VERSION (11 ,0 ,7 ))psp_sysfs_fini (adev);
--
2.25.1