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>
This commit is contained in:
Richard Chiang 2025-12-03 22:24:59 +08:00 committed by Alex Deucher
parent 9862d2ac66
commit a8936060a0

View File

@ -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;