summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Chiang <Richard.Chiang@amd.com>2025-12-03 17:24:59 +0300
committerAlex Deucher <alexander.deucher@amd.com>2026-01-06 00:59:58 +0300
commita8936060a01715552cac818019ca5e88201a3b7b (patch)
treed320f2c9a86b926511d49e4a3ae479323e2f7cb0
parent9862d2ac667a0e731aa75c17c1b146da809bc3ae (diff)
downloadlinux-a8936060a01715552cac818019ca5e88201a3b7b.tar.xz
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 <yihan.zhu@amd.com> Signed-off-by: Richard Chiang <Richard.Chiang@amd.com> Signed-off-by: Chenyu Chen <chen-yu.chen@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/display/dc/link/link_detection.c3
1 files changed, 3 insertions, 0 deletions
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;