]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/amd/display: Fix DisplayID not-found handling in parse_edid_displayid_vrr()
authorSrinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Sun, 15 Mar 2026 13:00:26 +0000 (18:30 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 17 Mar 2026 14:39:33 +0000 (10:39 -0400)
commit91c7e6342e98c846b259c57273436fdea4c043f2
tree52b1daf6c842f51114164b73731a2ab3c575ed7b
parent6736c8ff9d63e847a3b694aeaeb78d4e8ad42464
drm/amd/display: Fix DisplayID not-found handling in parse_edid_displayid_vrr()

parse_edid_displayid_vrr() searches the EDID extension blocks for a
DisplayID extension before parsing the dynamic video timing range.

The code previously checked whether edid_ext was NULL after the search
loop. However, edid_ext is assigned during each iteration of the loop,
so it will never be NULL once the loop has executed. If no DisplayID
extension is found, edid_ext ends up pointing to the last extension
block, and the NULL check does not correctly detect the failure case.

Instead, check whether the loop completed without finding a matching
DisplayID block by testing "i == edid->extensions". This ensures the
function exits early when no DisplayID extension is present and avoids
parsing an unrelated EDID extension block.

Also simplify the EDID validation check using "!edid ||
!edid->extensions".

Fixes the below:
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:13079 parse_edid_displayid_vrr() warn: variable dereferenced before check 'edid_ext' (see line 13075)

Fixes: a638b837d0e6 ("drm/amd/display: Fix refresh rate range for some panel")
Cc: Roman Li <roman.li@amd.com>
Cc: Alex Hung <alex.hung@amd.com>
Cc: Jerry Zuo <jerry.zuo@amd.com>
Cc: Sun peng Li <sunpeng.li@amd.com>
Cc: Tom Chung <chiahsuan.chung@amd.com>
Cc: Dan Carpenter <dan.carpenter@linaro.org>
Cc: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Reviewed-by: Tom Chung <chiahsuan.chung@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c