From a8936060a01715552cac818019ca5e88201a3b7b Mon Sep 17 00:00:00 2001 From: Richard Chiang Date: Wed, 3 Dec 2025 22:24:59 +0800 Subject: [PATCH] drm/amd/display: sink EDID data null check [Why] When sink EDID data pointer is NULL, it will cause an unexpected error. [How] Check data pointer is not NULL first. Reviewed-by: Yihan Zhu Signed-off-by: Richard Chiang Signed-off-by: Chenyu Chen Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/display/dc/link/link_detection.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/amd/display/dc/link/link_detection.c b/drivers/gpu/drm/amd/display/dc/link/link_detection.c index 373e68cf2bde..080642dfde2a 100644 --- a/drivers/gpu/drm/amd/display/dc/link/link_detection.c +++ b/drivers/gpu/drm/amd/display/dc/link/link_detection.c @@ -623,6 +623,9 @@ static bool detect_dp(struct dc_link *link, static bool is_same_edid(struct dc_edid *old_edid, struct dc_edid *new_edid) { + if (old_edid == NULL || new_edid == NULL) + return false; + if (old_edid->length != new_edid->length) return false; -- 2.47.3