From: Corbin McElhanney Date: Thu, 3 Aug 2017 22:29:42 +0000 (-0400) Subject: drm/amd/display: Fix accessing freed memory X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=5aa72db72ccc08c2d3d3e4b0a285bab932db5132;p=openwrt%2Fstaging%2Fblogic.git drm/amd/display: Fix accessing freed memory Signed-off-by: Corbin McElhanney Reviewed-by: Tony Cheng Acked-by: Harry Wentland Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c index f305780c36ce..b69a726717d9 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc.c @@ -1714,8 +1714,11 @@ void dc_update_planes_and_stream(struct dc *dc, } if (core_dc->current_context != context) { - dc_release_validate_context(core_dc->current_context); + struct validate_context *old = core_dc->current_context; + core_dc->current_context = context; + dc_release_validate_context(old); + } return;