From: Richard Chiang Date: Wed, 3 Dec 2025 14:24:59 +0000 (+0800) Subject: drm/amd/display: sink EDID data null check X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a8936060a01715552cac818019ca5e88201a3b7b;p=thirdparty%2Fkernel%2Flinux.git 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 --- 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;