mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-01 03:57:56 +00:00
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: JimQu <Jim.Qu@amd.com> Reviewed-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com> Acked-by: Harry Wentland <Harry.Wentland@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
8e545104aa
commit
ead964f24e
1 changed files with 5 additions and 1 deletions
|
@ -1096,8 +1096,12 @@ bool dc_commit_targets(
|
||||||
|
|
||||||
resource_validate_ctx_destruct(core_dc->current_context);
|
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;
|
core_dc->current_context = context;
|
||||||
|
memset(core_dc->temp_flip_context, 0, sizeof(*core_dc->temp_flip_context));
|
||||||
|
|
||||||
return (result == DC_OK);
|
return (result == DC_OK);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue