[PATCH 2/2] drm/amd/powerplay: fix memory leak in cz_hwmgr backend
Deucher, Alexander
Alexander.Deucher at amd.com
Tue Jun 6 15:17:13 UTC 2017
> -----Original Message-----
> From: amd-gfx [mailto:amd-gfx-bounces at lists.freedesktop.org] On Behalf
> Of Hawking Zhang
> Sent: Tuesday, June 06, 2017 4:36 AM
> To: amd-gfx at lists.freedesktop.org
> Cc: Zhang, Hawking
> Subject: [PATCH 2/2] drm/amd/powerplay: fix memory leak in cz_hwmgr
> backend
>
> vddc_dep_on_dal_pwrl is allocated and initialized in cz_hwmgr_backend_init
> Thus free the memory in cz_hwmgr_backend_fini
>
> Change-Id: Idd6dd4b76894579674bf334339b71df8559637fd
> Signed-off-by: Hawking Zhang <Hawking.Zhang at amd.com>
Series is:
Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
> ---
> drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c
> b/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c
> index 7aa5ca8..0b74da3 100644
> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c
> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c
> @@ -1224,6 +1224,12 @@ static int cz_hwmgr_backend_fini(struct
> pp_hwmgr *hwmgr)
> phm_destroy_table(hwmgr, &(hwmgr-
> >disable_dynamic_state_management));
> phm_destroy_table(hwmgr, &(hwmgr-
> >power_down_asic));
> phm_destroy_table(hwmgr, &(hwmgr->setup_asic));
> +
> + 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;
> + }
> +
> kfree(hwmgr->backend);
> hwmgr->backend = NULL;
> }
> --
> 2.7.4
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
More information about the amd-gfx
mailing list