From: Hawking Zhang Date: Tue, 6 Jun 2017 08:19:34 +0000 (+0800) Subject: drm/amd/powerplay: fix memory leak in rv_hwmgr backend X-Git-Tag: v4.13-rc1~73^2~20^2~56 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=95ef1f53c5fac7f32225a17a08e4aed320ac649a;p=users%2Fjedix%2Flinux-maple.git drm/amd/powerplay: fix memory leak in rv_hwmgr backend vddc_dep_on_dal_pwrl and vq_budgeting_table are allocated and initialized in rv_hwmgr_backend_init. Thus free the memory in rv_hwmgr_backend_fini Signed-off-by: Hawking Zhang Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c index 9b431511d274a..4c7f430b36eba 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c @@ -656,6 +656,16 @@ static int rv_hwmgr_backend_fini(struct pp_hwmgr *hwmgr) pinfo->vdd_dep_on_phyclk = NULL; } + if (NULL != hwmgr->dyn_state.vddc_dep_on_dal_pwrl) { + kfree(hwmgr->dyn_state.vddc_dep_on_dal_pwrl); + hwmgr->dyn_state.vddc_dep_on_dal_pwrl = NULL; + } + + if (NULL != hwmgr->dyn_state.vq_budgeting_table) { + kfree(hwmgr->dyn_state.vq_budgeting_table); + hwmgr->dyn_state.vq_budgeting_table = NULL; + } + kfree(hwmgr->backend); hwmgr->backend = NULL;