Commit a85c205a authored by Corbin McElhanney's avatar Corbin McElhanney Committed by Alex Deucher

drm/amd/display: Fix context copy memory leak

This change corrects an error introduced in 355f123f. Instead of
using the copy constructor to assign the new context, we swap the
pointer.
Signed-off-by: default avatarCorbin McElhanney <corbin.mcelhanney@amd.com>
Reviewed-by: default avatarDmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Acked-by: default avatarHarry Wentland <Harry.Wentland@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 4e5095ca
......@@ -972,7 +972,9 @@ static bool dc_commit_context_no_check(struct dc *dc, struct validate_context *c
dc_enable_stereo(dc, context, dc_streams, context->stream_count);
dc_resource_validate_ctx_copy_construct(context, core_dc->current_context);
dc_resource_validate_ctx_destruct(core_dc->current_context);
dm_free(core_dc->current_context);
core_dc->current_context = context;
return (result == DC_OK);
}
......@@ -1057,9 +1059,6 @@ bool dc_commit_streams(
result = dc_commit_context_no_check(dc, context);
dc_resource_validate_ctx_destruct(context);
dm_free(context);
return (result == DC_OK);
fail:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment