提交 ead964f2 编写于 作者: J jimqu 提交者: Alex Deucher

drm/amd/display: Fix memory corruption issue.

temp_flip_context is always same as current_context,
and the current_context will be freed in
dc_commit_targets(), but  temp_flip_context will be used in
dc_update_surfaces_for_target().
Signed-off-by: NJimQu <Jim.Qu@amd.com>
Reviewed-by: NAndrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Acked-by: NHarry Wentland <Harry.Wentland@amd.com>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 8e545104
......@@ -1096,8 +1096,12 @@ bool dc_commit_targets(
resource_validate_ctx_destruct(core_dc->current_context);
dm_free(core_dc->current_context);
if (core_dc->temp_flip_context != core_dc->current_context) {
dm_free(core_dc->temp_flip_context);
core_dc->temp_flip_context = core_dc->current_context;
}
core_dc->current_context = context;
memset(core_dc->temp_flip_context, 0, sizeof(*core_dc->temp_flip_context));
return (result == DC_OK);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册