Skip to content

Commit aac4cec

Browse files
Guchun Chenalexdeucher
authored andcommitted
drm/amdgpu: prevent toc firmware memory leak
It's missed in psp fini. Signed-off-by: Guchun Chen <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent d832db1 commit aac4cec

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,11 +486,14 @@ static int psp_sw_fini(void *handle)
486486
release_firmware(psp->ta_fw);
487487
psp->ta_fw = NULL;
488488
}
489-
if (adev->psp.cap_fw) {
489+
if (psp->cap_fw) {
490490
release_firmware(psp->cap_fw);
491491
psp->cap_fw = NULL;
492492
}
493-
493+
if (psp->toc_fw) {
494+
release_firmware(psp->toc_fw);
495+
psp->toc_fw = NULL;
496+
}
494497
if (adev->ip_versions[MP0_HWIP][0] == IP_VERSION(11, 0, 0) ||
495498
adev->ip_versions[MP0_HWIP][0] == IP_VERSION(11, 0, 7))
496499
psp_sysfs_fini(adev);

0 commit comments

Comments
 (0)