[PATCH 110/120] drm/amd/display: Fix accessing freed memory

Harry Wentland harry.wentland at amd.com
Wed Aug 9 15:02:36 UTC 2017


From: Corbin McElhanney <corbin.mcelhanney at amd.com>

Change-Id: I7bd6ec8b171178bab8e3a29b7fc4e6d17120e9aa
Signed-off-by: Corbin McElhanney <corbin.mcelhanney at amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng at amd.com>
Acked-by: Harry Wentland <Harry.Wentland at amd.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

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;
 
-- 
2.11.0



More information about the amd-gfx mailing list