提交 3a4775b8 编写于 作者: V Victor Lu 提交者: Zheng Zengkai

drm/amd/display: Decrement refcount of dc_sink before reassignment

stable inclusion
from stable-5.10.17
commit cd0604db18d22bc39dd8349d6b7ed2f8c79a627c
bugzilla: 48169

--------------------------------

[ Upstream commit 8e92bb0f ]

[why]
An old dc_sink state is causing a memory leak because it is missing a
dc_sink_release before a new dc_sink is assigned back to
aconnector->dc_sink.

[how]
Decrement the dc_sink refcount before reassigning it to a new dc_sink.
Signed-off-by: NVictor Lu <victorchengchi.lu@amd.com>
Reviewed-by: NRodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Acked-by: NAnson Jacob <Anson.Jacob@amd.com>
Tested-by: NDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
上级 bc56c4cb
...@@ -2261,8 +2261,10 @@ void amdgpu_dm_update_connector_after_detect( ...@@ -2261,8 +2261,10 @@ void amdgpu_dm_update_connector_after_detect(
* TODO: check if we still need the S3 mode update workaround. * TODO: check if we still need the S3 mode update workaround.
* If yes, put it here. * If yes, put it here.
*/ */
if (aconnector->dc_sink) if (aconnector->dc_sink) {
amdgpu_dm_update_freesync_caps(connector, NULL); amdgpu_dm_update_freesync_caps(connector, NULL);
dc_sink_release(aconnector->dc_sink);
}
aconnector->dc_sink = sink; aconnector->dc_sink = sink;
dc_sink_retain(aconnector->dc_sink); dc_sink_retain(aconnector->dc_sink);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册