mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 01:55:51 +02:00
drm/amd/display: detect_link_and_local_sink: DP alt mode timeout path leaks prev_sink reference
prev_sink is unconditionally retained via dc_sink_retain at function
entry, but the DP alt mode timeout path inside SIGNAL_TYPE_DISPLAY_PORT
returns false without releasing prev_sink. All other return paths in the
function correctly call dc_sink_release(prev_sink), making this the only
missing cleanup.
Fixes: 54618888d1 ("drm/amd/display: break down dc_link.c")
Signed-off-by: WenTao Liang <vulab@iscas.ac.cn>
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Link: https://patch.msgid.link/20260626124555.36910-1-vulab@iscas.ac.cn
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 45510cf662dcf46b5d8926d454f338809f107b9d)
Cc: stable@vger.kernel.org
This commit is contained in:
parent
220f22e1d6
commit
a6e14b976b
|
|
@ -1164,8 +1164,11 @@ static bool detect_link_and_local_sink(struct dc_link *link,
|
|||
link->link_enc->features.flags.bits.DP_IS_USB_C == 1) {
|
||||
|
||||
/* if alt mode times out, return false */
|
||||
if (!wait_for_entering_dp_alt_mode(link))
|
||||
if (!wait_for_entering_dp_alt_mode(link)) {
|
||||
if (prev_sink)
|
||||
dc_sink_release(prev_sink);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!detect_dp(link, &sink_caps, reason)) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user