Commit cd576e63 authored by Rex Zhu's avatar Rex Zhu Committed by Alex Deucher

drm/amd/powerplay: fix memory leak in cz_hwmgr.c

Signed-off-by: default avatarRex Zhu <Rex.Zhu@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 4c283acf
...@@ -1217,9 +1217,16 @@ static int cz_hwmgr_backend_init(struct pp_hwmgr *hwmgr) ...@@ -1217,9 +1217,16 @@ static int cz_hwmgr_backend_init(struct pp_hwmgr *hwmgr)
static int cz_hwmgr_backend_fini(struct pp_hwmgr *hwmgr) static int cz_hwmgr_backend_fini(struct pp_hwmgr *hwmgr)
{ {
if (hwmgr != NULL && hwmgr->backend != NULL) if (hwmgr != NULL) {
phm_destroy_table(hwmgr, &(hwmgr->enable_clock_power_gatings));
phm_destroy_table(hwmgr, &(hwmgr->set_power_state));
phm_destroy_table(hwmgr, &(hwmgr->enable_dynamic_state_management));
phm_destroy_table(hwmgr, &(hwmgr->disable_dynamic_state_management));
phm_destroy_table(hwmgr, &(hwmgr->power_down_asic));
phm_destroy_table(hwmgr, &(hwmgr->setup_asic));
kfree(hwmgr->backend); kfree(hwmgr->backend);
hwmgr->backend = NULL;
}
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment