]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/amd/display: Call dc_stream_release for remove link enc assignment
authorNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Mon, 24 Jan 2022 18:50:49 +0000 (13:50 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 11:57:58 +0000 (13:57 +0200)
[ Upstream commit f2bde8349c35d01d7c50456ea06a5c7d5e0e5ed0 ]

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

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

Fixes: 0bb245558584 ("drm/amd/display: retain/release at proper places in link_enc assignment")
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/display/dc/core/dc_link_enc_cfg.c

index a55944da8d53fbb18da1d9e237c21b9234163e09..00f72f66a7ef1cb9146d6b51456146ea8c43cd1d 100644 (file)
@@ -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);
                                break;
                        }
                }