summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLeon Elazar <leon.elazar@amd.com>2017-03-03 14:37:08 -0500
committerAlex Deucher <alexander.deucher@amd.com>2017-09-26 17:18:15 -0400
commit68339af3cb7fa32634170fe5cf5cba1335bb8cc9 (patch)
tree11cdb4c6387f97c69faa31f1247e0789470a4ac3 /drivers
parente8c963d6d970220ab33f4197ab4dea18c1615e52 (diff)
downloadlinux-68339af3cb7fa32634170fe5cf5cba1335bb8cc9.tar.bz2
drm/amd/display: Memory leak fix during disable
1.current_context memory wasn't released at dc_post_update_surfaces_to_stream during context swap. Signed-off-by: Leon Elazar <leon.elazar@amd.com> Acked-by: Harry Wentland <Harry.Wentland@amd.com> Reviewed-by: Tony Cheng <Tony.Cheng@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/amd/display/dc/core/dc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index 302a10c86afb..4fed2f25cd96 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -1046,6 +1046,9 @@ bool dc_post_update_surfaces_to_stream(struct dc *dc)
core_dc->hwss.set_bandwidth(core_dc, context, true);
resource_validate_ctx_destruct(core_dc->current_context);
+ if (core_dc->current_context)
+ dm_free(core_dc->current_context);
+
core_dc->current_context = context;
return true;