Skip to content

Commit

Permalink
drm/amd/powerplay: fix memory leakage when reload (v2)
Browse files Browse the repository at this point in the history
add smu_free_memory when smu fini to prevent memory leakage

v2: squash in typo fix (Yintian) and warning (Harry)

Signed-off-by: Yintian Tao <yttao@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
Yintian Tao authored and Alex Deucher committed Jan 10, 2018
1 parent 32b646b commit a25513e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,12 @@ int smu7_init(struct pp_hwmgr *hwmgr)

int smu7_smu_fini(struct pp_hwmgr *hwmgr)
{
struct smu7_smumgr *smu_data = (struct smu7_smumgr *)(hwmgr->smu_backend);

smu_free_memory(hwmgr->device, (void *) smu_data->header_buffer.handle);
if (!cgs_is_virtualization_enabled(hwmgr->device))
smu_free_memory(hwmgr->device, (void *) smu_data->smu_buffer.handle);

kfree(hwmgr->smu_backend);
hwmgr->smu_backend = NULL;
cgs_rel_firmware(hwmgr->device, CGS_UCODE_ID_SMU);
Expand Down

0 comments on commit a25513e

Please sign in to comment.