add smu_free_memory when smu fini to prevent memory leakage Change-Id: Id9103d8b54869b63f22a9af53d9fbc3b7a221191 Signed-off-by: Yintian Tao <yttao at amd.com> --- 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