Commit c64b0d6b authored by Victor Lu's avatar Victor Lu Committed by Alex Deucher

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

[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: default avatarVictor Lu <victorchengchi.lu@amd.com>
Reviewed-by: default avatarRodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Acked-by: default avatarAnson Jacob <Anson.Jacob@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 2dc39051
...@@ -2331,8 +2331,10 @@ void amdgpu_dm_update_connector_after_detect( ...@@ -2331,8 +2331,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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment