]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amd/display: sink EDID data null check
authorRichard Chiang <Richard.Chiang@amd.com>
Wed, 3 Dec 2025 14:24:59 +0000 (22:24 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 5 Jan 2026 21:59:58 +0000 (16:59 -0500)
[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>
drivers/gpu/drm/amd/display/dc/link/link_detection.c

index 373e68cf2bde972f5b9335e18eddc6ba2e4948ae..080642dfde2a060493afd334ebf334a269c4101d 100644 (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;