________________________________ From: amd-gfx <amd-gfx-bounces@xxxxxxxxxxxxxxxxxxxxx> on behalf of Yintian Tao <yttao at amd.com> Sent: Sunday, December 31, 2017 10:16 PM To: amd-gfx at lists.freedesktop.org Cc: Tao, Yintian Subject: [PATCH] drm/amd/powerplay: fix memory leakage when reload add smu_free_memory when smu fini to prevent memory leakage Change-Id: Id9103d8b54869b63f22a9af53d9fbc3b7a221191 Signed-off-by: Yintian Tao <yttao at amd.com> Reviewed-by: Alex Deucher <alexander.deucher at amd.com> Looks like vega10, cz, rv have the same issue can you send patches for them as well? Thanks, Alex --- drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c index c49a6f2..925217e 100644 --- a/drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c +++ b/drivers/gpu/drm/amd/powerplay/smumgr/smu7_smumgr.c @@ -607,6 +607,12 @@ int smu7_init(struct pp_smumgr *smumgr) int smu7_smu_fini(struct pp_smumgr *smumgr) { + struct smu7_smumgr *smu_data = (struct smu7_smumgr *)(smumgr->backend); + + smu_free_memory(smumgr->device, smu_data->header_buffer.handle); + if (!cgs_is_virtualization_enabled(smumgr->device)) + smu_free_memory(smumgr->device, smu_data->smu_buffer.handle); + if (smumgr->backend) { kfree(smumgr->backend); smumgr->backend = NULL; -- 2.7.4 _______________________________________________ amd-gfx mailing list amd-gfx at lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx -------------- next part -------------- An HTML attachment was scrubbed... URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20180102/eb00f02e/attachment.html>