[PATCH] drm/amd/display: Call dc_stream_release for remove link enc assignment

Nicholas Kazlauskas nicholas.kazlauskas at amd.com
Mon Jan 24 18:57:01 UTC 2022

A porting error resulted in the stream assignment for the link
being retained without being released - a memory leak.

Fix the porting error by adding back the dc_stream_release() intended
as part of the original patch.

Fixes: 2e45b19dd882 ("drm/amd/display: retain/release at proper places in link_enc assignment")

Cc: Qingqing Zhuo <qingqing.zhuo at amd.com>
Cc: Aurabindo Pillai <aurabindo.pillai at amd.com>
Cc: Rodrigo Siqueira <Rodrigo.Siqueira at amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas at amd.com>
 drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c
index a55944da8d53..00f72f66a7ef 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c
@@ -122,6 +122,7 @@ static void remove_link_enc_assignment(
 				stream->link_enc = NULL;
 				state->res_ctx.link_enc_cfg_ctx.link_enc_assignments[i].eng_id = ENGINE_ID_UNKNOWN;
 				state->res_ctx.link_enc_cfg_ctx.link_enc_assignments[i].stream = NULL;
+				dc_stream_release(stream);

More information about the amd-gfx mailing list